After putting some stuff as Anonymous (
#639826)
I did some research on the topic.
What's the status of the beer meter anyway?
OK, there is no way in pure Perl to come even
close to a tailored inline solution, so if its
important one has to use it.
I compiled several snippets from this thread
into one benchmark ==> http://hobbit.chemie.uni-halle.de/project/meterofbeer/
and added some results.
One very interesting outcome for me was the
revelation of how dead slow the Core2 architecture
was at repeated assembly string opcodes
like
repne scasb.
By rewriting the scasb by a sequence of "mov"
it will be blazingly fast on a Core2.
There seems to be some error in the
sub "corion" ==>
http://hobbit.chemie.uni-halle.de/project/meterofbeer/beerbench.pl
maybe somebody can fix it.
This is on a Core2/Q6600@3GHz (more results in the
other link):
Rate
split1 7.35/s
ikegami1 36.6/s
substr1 45.9/s
mrm_6 1169/s
avar2 1536/s
corion 1662/s
avar2_pos 2701/s
mrm_3 2819/s
ikegami2 3137/s
bart 3480/s
ikegami3 3488/s
mrm_1 3508/s
ikegami4 3655/s
moritz 3719/s
mrm_5 4271/s
mrm_4 4346/s
rep_scasb 4495/s
inline_c 11310/s
cmp_movb 11563/s
Interesting stuff!
Thanks & bye
Mirco
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.