in reply to Re^2: cannot get Benchmark to work
in thread cannot get Benchmark to work
It is because Benchmark evals the code either way. It runs the code in the calling package, so if you give it a string to eval, then it just concatenates the package switching wrapper around the code, and evals it. If you give it a code ref, it just wraps the string "&$ref()" in a similar fashion.
Either way, you suffer the same eval STR overhead. In the subref case, you also suffer the cost of a function call.
|
|---|