RESOLVED FIXED 27030
[WINCE] random number generator is too slow
https://bugs.webkit.org/show_bug.cgi?id=27030
Summary [WINCE] random number generator is too slow
Joe Mason
Reported 2009-07-07 08:14:04 PDT
The default WinCE RNG is very slow, so we replaced it with Mersenne Twister, which performs well and is well-studied.
Attachments
patch adding mt19937ar.c for WinCE (8.64 KB, patch)
2009-07-07 08:32 PDT, Joe Mason
staikos: review-
updated patch (9.49 KB, patch)
2009-07-07 10:40 PDT, Joe Mason
manyoso: review+
Joe Mason
Comment 1 2009-07-07 08:32:38 PDT
Created attachment 32379 [details] patch adding mt19937ar.c for WinCE
George Staikos
Comment 2 2009-07-07 09:20:40 PDT
Comment on attachment 32379 [details] patch adding mt19937ar.c for WinCE The initialization code should be brought inline with the current system where a function is called.
Joe Mason
Comment 3 2009-07-07 10:40:09 PDT
Created attachment 32386 [details] updated patch Done. Also added an srand call so that the default RNG used to fill the initialization array for MT is itself initialized - I believe in the first patch it was always using the same seed.
Joe Mason
Comment 4 2009-07-07 10:47:20 PDT
Correction: the first patch did call srand because we called initializeRandomNumberGenerator before filling in the array. The second patch needs to call srand explicitly because we replaced part of initializeRandomNumberGenerator instead of calling it first.
Eric Seidel (no email)
Comment 5 2009-07-07 15:54:04 PDT
Comment on attachment 32386 [details] updated patch The URL in the license http://www.math.keio.ac.jp/matumoto/emt.html is invalid. Where can we go to validate that this code is properly licensed?
Joe Mason
Comment 6 2009-07-07 16:25:37 PDT
Current site seems to be http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html The version of mt19937ar.c for download there is identical except that the url and contact email are different and it includes an extra test function: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
George Staikos
Comment 7 2009-07-08 00:07:16 PDT
License is BSD.
Adam Treat
Comment 8 2009-07-14 07:51:39 PDT
Comment on attachment 32386 [details] updated patch License from given urls is BSD. The copy that goes in should have updated url and contact info. Otherwise looks good.
Adam Treat
Comment 9 2009-07-14 13:22:33 PDT
Landed with r45865.
Note You need to log in before you can comment on or make changes to this bug.