in reply to Re^2: How expensive is eval { }?
in thread How expensive is eval { }?

No real idea, but bear in mind that most likely we are looking at only a few instructions' execution time difference between each case so they could be highly sensitive to optimization or modest differences in instruction timing between different processors (I ran my tests on a Turion64 powered laptop btw).

Beyond indicating that the eval overhead is small enough to be discounted in most practical contexts, the benchmark really doesn't tell us very much - except that you can't trust benchmarks very much for this sort of fine grain comparison. The important thing to note is that the eval costs much less than 1 micro-second.


Perl is environmentally friendly - it saves trees