in reply to How expensive is eval { }?

eval{} is about 30x faster than not using it. Of course, this assumes that your coding style is predisposed to using exceptions. Mine isn't, so eval{} is about 2x slower for me.

Of course, I'm talking programmer speed. Execution speed matters very little when working in Perl. If it did, you wouldn't be working in Perl.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: How expensive is eval { }?
by mscharrer (Hermit) on Apr 17, 2008 at 13:47 UTC
    I was actually talking about execution speed. I know Perl is not the fastest, but just wanted to know if the use of eval { } slows things down significantly. Eval remembers me a little on a fork which sounds runtime expensive if done very often.
    However the benchmarks in the other posts show that this is not the case, even if they are not very accurate.

    Thanks for your reply.