Re: are arrays contiguous in memory?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



> He has correctly challenged your statement that "with a faster computer
> and more memory it really doesn't matter which method is used!". Indeed,
> for large amounts of data, it matters a lot.

Except this statement is taken out of context. My ORIGINAL statement was
made in an obviously jovial manner (note smiley at end that has been omitted
since), it was about the SPECIFIC problem regarding contiguous memory (the
topic of this thread), and the 'challenge' was then made in the GENERAL
case. That's not fair... : )

To be serious here, we are talking about two different things here. I'm
talking about how processor speed makes a big difference in algorithmic
design choice in most real world applications. You guys are talking about
computer science. Apples and ibms - er - oranges...

[==P==]


"Brian Muth" <bmuth@xxxxxxxx> wrote in message
news:ulmr4dPBGHA.2040@xxxxxxxxxxxxxxxxxxxxxxx
>> These methods both do the same thing (if you don't believe me, test
>> them!). But, in the 'old days' the former method would have been the
>> wrong way to go for small values of X since in those the days people
>> counted clock cycles, and the multiply instruction took about 50-100
>> longers to do than the add instruction.
>>
>> But since computers, through piping and other methods, have gotten adds
>> and mutliplies down to the same 1-cycle speed, nowadays the
>> algorithmically simpler method is the way to go. That's because today
>> this algorithmically simpler method executes faster than the 'clever' one
>> (and as a side benefit saves memory, is more intuitive, is less prone to
>> error, and can be programmed in less time).
>>
>> So, theoretically you are correct. In practice, you're not-so-correct...
>> : )
>
> This argument is entirely irrelevant.
>
> Arnaud has correctly pointed out that lookups with lists are of O(n)
> whereas lookups with vectors are of constant order. Advances in processor
> speeds don't change this. Advances in floating point arithmetic don't
> change this. He has correctly challenged your statement that "with a
> faster computer and more memory it really doesn't matter which method is
> used!". Indeed, for large amounts of data, it matters a lot.
>
> Best regards,
>
> Brian
>
>


.



Relevant Pages

  • Re: Populating a dictionary, fast [SOLVED]
    ... Lookups there should be much faster than using a dictionary as well. ... specialized libraries can directly load into memory ... huge amounts of continuous data at speeds that substantially ...
    (comp.lang.python)
  • Re: optimization
    ... memory to speed up the InsertItemcalls. ... the value to the CArray, ... showing all the primes and their index or sequence number. ... measured at such low speeds is basically the time to copy data into the ...
    (microsoft.public.vc.mfc)
  • OT: when is parallel not parallel?
    ... well, something akin to the Memory Channel, as I think it was called, so ... data would transfer at near memory-bus speeds. ... parallel bit channels running over a single FC cable. ... parallel interface have settled to their final values. ...
    (comp.os.vms)
  • Re: OT: when is parallel not parallel?
    ... well, something akin to the Memory Channel, as I think it was called, so ... data would transfer at near memory-bus speeds. ... parallel interface have settled to their final values. ... If I knew enough about SIMH I'd even speculate on ...
    (comp.os.vms)
  • Re: Upgrade the motherboard?
    ... memory is important -- and newer types of memory are much faster than the ... (your board only supports IDE operation at UDMA33 speeds, ... so your existing PSU may not be happy driving modern kit -- ... Modern boards will have enough USB ports without this. ...
    (uk.comp.homebuilt)