[fpc-pascal] Why is Random(255) some 529x slower compared to Delphi 7?

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Dec 9 17:32:06 CET 2011


On 9 December 2011 15:51, Reimar Grabowski wrote:
>knowledge to back up your statements. Next time please take the time to identify the problem >correctly before jumping to conclusions.
> No offense ment.

No offense take. Two unknown (to most) facts came out of this
discussion.  1) the FPC Random() function IS slower than Delphi's. 2)
FPC implements a different random generator than Delphi. Is this good
or bad? Considering the "must be Delphi compatible" term thrown around
so often. Even with the original (slightly non-optimal usage of
Random) code, Delphi ran it fine and fast, FPC didn't. So from a
porting point of view (Delphi to FPC), there was a problem which
others might get caught in as well.

Either way, thanks to Vincent's sharp eye, which everybody but Vincent
overlooked, the speed problem in the tiOPF code can be greatly reduced
to acceptable levels with FPC - even though FPC has a different random
generator.

Thanks to all that participated and helped solve my problem. It was an
interesting discussion as always.


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net



More information about the fpc-pascal mailing list