Author: Sune Fischer
Date: 14:52:29 09/15/01
Go up one level in this thread
On September 15, 2001 at 17:11:29, J. Wesley Cleveland wrote: >On September 15, 2001 at 16:17:52, Vincent Diepeveen wrote: >Note that this fails if a+b = 2^32. It would be expecting too much for a >compiler to know that this could not happen. Also, pointer notation can cause >some code to run slower, because the compiler can not perform some optimizations >because of possible pointer aliasing. LOL, thank you all for your insight, I will try rewriting it to use pointers. I've been using references ever since I read the following in a C++ book: "Specifying a parameter to a function as a reference changes the method of passing data for that parameter. The method used is not pass-by-value where an argument is copied before being passed, but pass-by-reference where the parameter acts as an alias for the argument passed. This eliminates any copying and allows the function to access the caller argument directly. It also means that the de-referencing, which is required when passing and using a pointer to a value, is also unnecessary." That lead me to believe that pointers where actually slower, however I have never tested for myself. I have always believed that C++ was slower than C, some people I know thinks otherwise. Anyone have an estimate of how much slower it is? I've been thinking of rewriting to C++, but no way if it would slow it down! -S.
This page took 0 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.