|
|
scott wrote:
>> It's got so bad that theoretically "inferior" algorithms can actually
>> be faster due to cache behaviour, even though they take "more
>> operations" to do.
>
> Only "inferior" if you assume they run on a machine that can access
> every single data location and process every single instruction at a
> constant speed.
Or rather, if you assume that every possible "operation" takes the same
amount of time - a highly useful simplification if you're trying to
compare several different algorithms.
> As you pointed out, this certainly isn't the case and things are much
> more complex now, but that shouldn't put you off trying to optimise your
> code, you should just optimise it to work with the cache first rather
> than with the ALU.
What this means is that any programming language that features automatic
memory management is instantly many hundred times slower than a language
using manual memory management, and there's nothing you can do about it.
I find that sad.
Post a reply to this message
|
|