Author: Eugene Nalimov
Date: 11:55:54 08/31/99
Go up one level in this thread
Please notice - I compared virtual method call not with the if statement, but with indirect function call. And once again - performance in those cases is comparable. And yes, you are absolutely right, for small amount of alternatives(less than ~5 possible cases) if's are better. Eugene On August 31, 1999 at 13:03:43, Dan Andersson wrote: >On August 31, 1999 at 08:16:31, Dan Andersson wrote: > >>The extra instructions could cause cashe overwrites and such, thus making it a >>memory bound penalty. I know that vtables are a very bad deal on x86 machines, >>much better to use switches and inlined functions. >I meant building binary desicision trees w. if statements, and inlined >functions. On x86 you can do aprox. four or five conditional jumps at the same >performance cost as one vtable lookup. If it is possible to know the >probabilities of method calls it is a win to make Huffman codes and construct an >unbalanced tree corresponding to them. >> C++ is only about 30% faster >>than natively compiled OCAML, a much better prototyping and developement >>language. >> >>Regards DAn
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.