[fpc-pascal] Why is Random(255) some 529x slower compared to Delphi 7?
Graeme Geldenhuys
graemeg.lists at gmail.com
Wed Dec 7 14:10:14 CET 2011
On 7 December 2011 14:54, Jonas Maebe wrote:
>
> That's correct. We use the mersenne twister, Delphi probably a linear
> congruential generator. The mersenne twister has a much larger period.
OK thanks for the info. This is a serious performance hit, but I
understand that the FPC implementation is different. Does FPC have a
faster (comparable to Delphi) version of Random() too?
@Michael,
Should the FPC docs maybe mention the fact that the FPC version is
considerably slower that Delphi (with an explanation why of course) -
purely for the purpose of informing those porting code from Delphi to
FPC. The original code in tiOPF is so slow, I almost thought the
program froze - thus making that code really unusable in an
application. Luckily that code will normally not be used in a real app
though. Delphi developers wanting to move to FPC should really be
warned about this, and use Random() sparingly.
--
Regards,
- Graeme -
_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net
More information about the fpc-pascal
mailing list