I am confused. Is not $_[0] aliased to the function argument? Why using all those references and dereferences? Moreover, running your code with N=2**29, I am still getting
single 6.13e-03/s -- -100% -100% -100% -100%
long 2.97/s 48381% -- -1% -35% -58%
translate 3.01/s 48989% 1% -- -35% -58%
classic 4.60/s 74981% 55% 53% -- -36%
str 7.14/s 116486% 140% 137% 55% --
With 2**30, it dies with Substitution loop at ./7.pl line 10.
Update: This is perl 5, version 16, subversion 0 (v5.16.0) built for x86_64-linux-thread-multi
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|