POV-Ray : Newsgroups : povray.off-topic : you & me right now, warp : Re: you & me right now, warp Server Time
6 Sep 2024 21:20:48 EDT (-0400)
  Re: you & me right now, warp  
From: scott
Date: 17 Feb 2009 10:42:43
Message: <499adaf3$1@news.povray.org>
>>> Nothing is faster than C, some wise men said. ;)
>>
>> Assembler is.
>>
>
> Back in the days before modern processors I'd say absolutely. But nowadays 
> that's debatable. Due to multiple pipelines, the criticality of cache hits 
> and advances in compiler design, it's very difficult to beat C with 
> assembler.

Well it really depends on how *difficult* it is to match or beat any 
language with assembler.  It's always theoretically possible, but as you say 
with modern CPU and compiler design it is becoming increasingly harder.

If you really know the CPU and system architecture well I would imagine that 
a skilled programmer could write a small section of assembler to run faster 
than a compiler, just because humans are better at that sort of optimisation 
(they can consider a lot more things intelligently that a compiler can't, 
for example changing the algorithm slightly to better match the hardware). 
But humans tend to be very slow at this, a compiler can perform simpler 
optimisations over much larger programs far quicker.


Post a reply to this message

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