TT800 (was RE: PRNGs (was [Q] Project: Better performance fo r
LargeIntegers))
Baveco, Dr. J.M.
J.M.Baveco at ibn.dlo.nl
Fri Nov 5 08:28:59 UTC 1999
Thanks for the code! However, I think the attachment missed a last
few lines (the instantiation category at the class side).
I guess you redefined <new> there, to return <super new initialize>?
hans
> OK, I got it and have converted it to Squeak (with some testing
> assistance from Jeff). The code is attached. It's basically a
> straight conversion from C. It uses, by its nature, 32-bit long
> integers and is slow by a factor of about 30 relative to Squeak's
> Random class.
>
> References and abstracts to the papers are included in the class
> comment. The original C code (less its tiny main program) is in a
> method as a comment. There are class methods that test the generator
> and also assure that it answers the same results as the C version.
>
> This is a good example of why long integers need to be fast, and how
> easy it is to hit that performance brick wall.
>
> If you are using Random, you can try this by changing the class name
> to RandomTT800. The #next method answers the next pseudo-random
> number and #seed: resets the seed. The generator automatically self
> seeds from the millisecond clock.
>
> Dave << File: Random-TT800.4Nove333pm.cs >> << File: ATT1337399.txt >>
More information about the Squeak-dev
mailing list
|