Don't quote me out of context. I was replying to BrowserUKs technique of putting the loop inside the code to benchmark. Once you put the (or a) loop into the code you benchmark, anything Benchmark.pm tries to do compensate for running an empty loop is fruitless.
Yes I agree. And i quoted you out of context because I wanted to make a point about what Benchmark does wrong, not set you up or make you look dumb or anything. Sorry if it seemed that way.
Now, do I care whether the it also times the overhead of the loop? No. Either the overhead of the loop is significant, or not. If it's significant, it doesn't matter (for a performance point of view) which solution I pick.
I agree entirely.
Now, if I really want to be fancy (and when I do need to benchmark something more seriously than something trivial on perlmonks), I run the benchmark 100 or 1000 times, keeping track of the results, ..... And I do it with different datasets. All things Benchmark doesn't support anyway.
Ive often wanted, and a few times tinkered with a more flexible and less "clever" Benchmark framework.
In reply to Re^9: &1 is no faster than %2 when checking for oddness. (Careful what you benchmark)
by demerphq
in thread &1 is no faster than %2 when checking for oddness. Oh well.
by diotalevi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |