Just for fun, I rearranged the order of declaration, putting get_value() and get_value2() ahead of a(), b(), and c() (as in No More Meaningless Benchmarks!). Here are the results of the first run:
$ perl oo_benchmark.pl (warning: too few iterations for a reliable count) (warning: too few iterations for a reliable count) (warning: too few iterations for a reliable count) Rate normal optimized direct normal 142857143/s -- -14% -57% optimized 166666667/s 17% -- -50% direct 333333333/s 133% 100% --
Here are the results of my modified program:
$ perl oo_benchmark.pl (warning: too few iterations for a reliable count) (warning: too few iterations for a reliable count) (warning: too few iterations for a reliable count) Rate direct normal optimized direct 125000000/s -- -25% -25% normal 166666667/s 33% -- 0% optimized 166666667/s 33% 0% --
I conclude that these kinds of benchmarks are meaningless.
In reply to Re: Unexpected OO accessor benchmarks
by chromatic
in thread Unexpected OO accessor benchmarks
by cLive ;-)
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |