[fpc-pascal] Re: Why is Random(255) some 529x slower compared to Delphi7?

DaWorm daworm at gmail.com
Thu Dec 8 12:25:16 CET 2011


Why sprinkle ifdefs everywhere?  Change all calls to Random with calls to
FastRandom, and have one ifdef there that uses Random in Delphi and a fast
substitute in FPC.  Still readable, still fast, and you would be done by
now instead of spending so much time arguing about it.  Plus, should Delphi
decide to change their Random call to something slower in the next rev, you
only have to change one routine to switch back to a faster version.  Maybe
later a patch could be worked on to implement FastRandom and BetterRandom
in the RTL, and use some sort of procedure variable to allow Random to call
one or the other.  But you'd probably find the need to do that isn't so
urgent once you've made the other change.

Jeff.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20111208/17941f85/attachment.html>


More information about the fpc-pascal mailing list