Some new benchmarks 7.2.550 vs 7.4.35 vs 7.5.13 using shootout tests:
Pike7.2 Pike7.4 Pike7.5 1: 5.62 4.50 2.52 (ackermann) 2: 10.27 6.72 6.84 (ary3) 3: 8.55 6.62 6.42 (fibo) 4: 5.92 4.78 4.61 (hash) 5: 11.05 7.22 6.09 (heapsort) 6: 7.46 6.69 6.56 (lists) 7: 8.19 8.25 6.09 (methcall) 8: 54.21 5.91 6.47 (nestedloop) 9: 6.04 5.23 4.99 (objinst) 10: 7.29 4.79 5.21 (random) 11: 9.95 6.71 4.54 (sieve) 12: 3.13 2.33 2.50 (strcat)
Scoring based on position in tests (should probably be updated to include difference in percent):
1: Pike7.5 32 2: Pike7.4 27 3: Pike7.2 13
Is that with the new version of the hash-test I wrote some years ago, or the old one using indices() and values()?
/ Per Hedbor ()
Previous text:
2003-12-03 00:13: Subject: Pike benchmarks
Some new benchmarks 7.2.550 vs 7.4.35 vs 7.5.13 using shootout tests:
Pike7.2 Pike7.4 Pike7.5 1: 5.62 4.50 2.52 (ackermann) 2: 10.27 6.72 6.84 (ary3) 3: 8.55 6.62 6.42 (fibo) 4: 5.92 4.78 4.61 (hash) 5: 11.05 7.22 6.09 (heapsort) 6: 7.46 6.69 6.56 (lists) 7: 8.19 8.25 6.09 (methcall) 8: 54.21 5.91 6.47 (nestedloop) 9: 6.04 5.23 4.99 (objinst) 10: 7.29 4.79 5.21 (random) 11: 9.95 6.71 4.54 (sieve) 12: 3.13 2.33 2.50 (strcat)
Scoring based on position in tests (should probably be updated to include difference in percent):
1: Pike7.5 32 2: Pike7.4 27 3: Pike7.2 13
/ Martin Nilsson (saturator)
void main(int argc, array(string) argv) { int i, c = 0; int n = (int)argv[-1]; if (n < 1) n = 1;
mapping(string:int) X = ([]);
for (i=1; i<=n; i++) { X[sprintf("%x", i)] = i; } for (i=n; i>0; i--) { if (X[(string)i]) c++; } write("%d\n", c); }
/ Martin Nilsson (saturator)
Previous text:
2003-12-03 11:24: Subject: Pike benchmarks
Is that with the new version of the hash-test I wrote some years ago, or the old one using indices() and values()?
/ Per Hedbor ()
Ah. The deprecated hash1-test. Try the hash2 test, that is not really a sprintf-test.
/ Per Hedbor ()
Previous text:
2003-12-03 11:27: Subject: Pike benchmarks
void main(int argc, array(string) argv) { int i, c = 0; int n = (int)argv[-1]; if (n < 1) n = 1;
mapping(string:int) X = ([]);
for (i=1; i<=n; i++) { X[sprintf("%x", i)] = i; } for (i=n; i>0; i--) { if (X[(string)i]) c++; } write("%d\n", c); }
/ Martin Nilsson (saturator)
Hash tests compared.
Pike7.2 Pike7.4 Pike7.5 1: 5.86 4.78 4.60 (hash) 2: 30.18 21.39 21.36 (hash2)
/ Martin Nilsson (saturator)
Previous text:
2003-12-03 11:24: Subject: Pike benchmarks
Is that with the new version of the hash-test I wrote some years ago, or the old one using indices() and values()?
/ Per Hedbor ()
http://www.bagley.org/~doug/shootout/bench/hash2/hash2.pike
/ Martin Nilsson (saturator)
Previous text:
2003-12-05 09:54: Subject: Pike benchmarks
Which version of hash2?
/ Per Hedbor ()
Aha.
foreach (hash1; string a; string k) { hash2[k] += a; }
/ Per Hedbor ()
Previous text:
2003-12-05 10:09: Subject: Pike benchmarks
http://www.bagley.org/~doug/shootout/bench/hash2/hash2.pike
/ Martin Nilsson (saturator)
Jämför t.ex. med C
for (node=ht_first(ht1); node; node=ht_next(ht1)) { ht_find_new(ht2, node->key)->val += node->val; }
ocaml
for i = 1 to n do Hashtbl.iter update_hash2 hash1 done;
php
for ($i = $n; $i > 0; $i--) { foreach($hash1 as $key => $value) $hash2[$key] += $value; }
etc.
/ Per Hedbor ()
Previous text:
2003-12-05 10:49: Subject: Pike benchmarks
Fast det där är ju fel ordning på argumenten, och a är en int.
/ Per Hedbor ()
pike-devel@lists.lysator.liu.se