I did this on two machines: an old dog, and a new burner.
System 1: HP 9000 Model H50 (PA-7100, 96 Mhz), 256 MB RAM, HP-UX 10.20
$ perl -v
This is perl, version 5.005_03 built for PA-RISC1.1
results: Benchmark: timing 1000000 iterations of Grep, Max, Ternary...
Grep: 26 wallclock secs (21.98 usr + 0.17 sys = 22.15 CPU)
Max: 33 wallclock secs (31.87 usr + 0.07 sys = 31.94 CPU)
Ternary: 35 wallclock secs (33.29 usr + 0.13 sys = 33.42 CPU)
System 2: HP9000 C3000 (PA-8500, 400 Mhz), 512 MB RAM, HP-UX 10.20
Same version of perl
results:
Benchmark: timing 1000000 iterations of Grep, Max, Ternary...
Grep: 5 wallclock secs ( 4.83 usr + 0.00 sys = 4.83 CPU)
Max: 7 wallclock secs ( 6.77 usr + 0.01 sys = 6.78 CPU)
Ternary: 7 wallclock secs ( 6.90 usr + 0.00 sys = 6.90 CPU)
These are my answers, and I'm sticking to them!
-
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.