Benchmark your failures

Ever given any thought as to what the expense of catching exceptions with Try::Tiny or even eval might be?

Recently a colleague was having some issues with a legacy codebase that was having requests exceed their nginx proxy timeouts. We discussed increasing those timeouts, but considered that a last resort.

One block of code being executed was along the lines of


eval { do_this() };
if (! $@) {
plan_a()
} else {
plan_b()
}

About Russell Jenkins

user-pic Random adventures of a perl hacker.