Benchmarking: assign then `if var.nil?`, casting and `try` operator, when calling a method in a variable that can be `Nil`

It’s always unclear to me what micro-benchmarks like this actually prove. Like it’s entirely possible LLVM is just optimizing some/all of the blocks away, skewing your results.

Related: How to use benchmark correctly?

1 Like