I just added 64-bit integer support to my
Math::Random::MT::Auto
module. To my surprise, I determined that the module was now
66% faster than before!
I don't think it has to do with the 64-bit version of the Mersenne Twister
algorithm that the module uses, as it runs through essentially the same code
as the 32-bit version
(just using different constants). In fact, the 64-bit version has to refresh
the random number buffer twice as often, so it's actually doing more work!
One source of improvement may be better utilization of the CPU (Pentium 4)
with everything getting done in 64-bit mode to match the CPU registers.
Another may be that since my Perl is compiled with 'use64bitint', it may be
using the 64-bit ints from the PRNG directly, and not having to convert them
from 32-bits (output of the old PRNG) to 64-bits (Perl's internal
representation). (Not sure about this.)
Regardless, it was totally unexpected. Anyone else had any experience with
this sort of thing?
Remember: There's always one more bug.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.