[fpc-pascal] Why is Random(255) some 529x slower compared to Delphi 7?
ik
idokan at gmail.com
Wed Dec 7 18:00:17 CET 2011
On Wed, Dec 7, 2011 at 18:35, Florian Klaempfl <florian at freepascal.org>wrote:
>
> FPC uses MT at least for 10 years and nobody complained about
> performance yet. So I suspect the cases might be very rare when random
> performance matters and having good random numbers is always a good
> thing ... I prefer not to change it but it's fine for me for delphi
> compatibility's sake ;)
>
I have a better idea.
Today FPC allow me to register different memory allocation implementation
that GetMem etc will use.
The same for string and widechar etc...
Why not to add such support for randomness as well ? Allow me to register
different random functions. Also might change the randomize procedure.
That way, we can use many random types according to how we wish to have it.
So in one unit I can use the Delphi's version, on the other the FPC's
version, and on the 3rd, something else.
On Delphi mode btw you can use by default the Delphi equivalent, and also
allow compiler directive and cli tags to active/inactive such algorithms.
What do you think ?
Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20111207/1c4158f6/attachment.html>
More information about the fpc-pascal
mailing list