11
votes
Pimp your random numbers with XorShift!
DelphiTools
– A 64bit XorShift is now used to generate random numbers in DWScript, and there is a now a separate random number generator per-execution, which is auto-randomized when an execution is created. Previously, the RTL random generator was used, this was “okay” when you had only one script using random numbers at a time, but multiple scripts running at the same time would interfere (Randomize calls would affect each others f.i.), and Random isn’t really thread-safe. Performance fo XorShift is roughly comparable to the Delphi RTL’s linear congruential generator, but with much ...
Statistics
|
Visits by Source |
User Actions |




