POV-Ray : Newsgroups : povray.off-topic : As fast as C : Re: As fast as C Server Time
6 Sep 2024 13:20:21 EDT (-0400)
  Re: As fast as C  
From: Invisible
Date: 16 Dec 2008 09:52:44
Message: <4947c0bc$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.