Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: assembler vs. C

Author: Ratko V Tomic

Date: 11:55:47 11/08/99

Go up one level in this thread


> I agree that a good compiler (like MSVC) produces code on par with a good
> assembly coder.

Not even close. Namely, what you were comparing was:

> I too have studied the code listings and tried to improve
> it. Generally, there are only one or two instructions that can be tweeked,
> and the speed up have never been large enough to be really measureable.

That is not assembly coding (much less a good assembly coding) but trying to
hand-simulate a C compiler (and as you noted, that's mostly a waste of time).

The native assembly program (not a tweaked C compiler output) is for any
resonably complex data manipulation (i.e. for other than just copying arguments
to struct fields or pushing arguments and calling a function or other simple
stuff) at least couple times faster than a compiler's output. In my consulting
work I had over years optimized many times existent C/C++ code (for graphics,
compression, encryption, search) by switching to the native assembly language
algorithms in the critical portions of the task, ending up with 3-5 times faster
critical sections.

When you tailor the algorithm to the CPU architecture, you can use it much
better, knowing well its strenghts and its limitations, than if you tailor it to
a virtual C architecture and the compiler mechanically translates it to the
actual CPU model.




This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.