Re: are arrays contiguous in memory?
- From: "Peteroid" <peter_oliphant@xxxxxxx>
- Date: Mon, 19 Dec 2005 21:56:28 -0800
> 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
>
>
.
- References:
- are arrays contiguous in memory?
- From: Peteroid
- Re: are arrays contiguous in memory?
- From: Nishant Sivakumar
- Re: are arrays contiguous in memory?
- From: Willy Denoyette [MVP]
- Re: are arrays contiguous in memory?
- From: Arnaud Debaene
- Re: are arrays contiguous in memory?
- From: Willy Denoyette [MVP]
- Re: are arrays contiguous in memory?
- From: Peter Oliphant
- Re: are arrays contiguous in memory?
- From: Arnaud Debaene
- Re: are arrays contiguous in memory?
- From: Peter Oliphant
- Re: are arrays contiguous in memory?
- From: Brian Muth
- are arrays contiguous in memory?
- Prev by Date: Re: Compile error C4430 with Visual C++ 2005
- Next by Date: Re: what is an enum?
- Previous by thread: Re: are arrays contiguous in memory?
- Next by thread: Re: are arrays contiguous in memory?
- Index(es):
Relevant Pages
|