Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
set_backtrace should disable backtrace generation on raise #5605
Reported by @jeremyevans while improving perf of no-trace flow control exceptions.
The following benchmarks should perform roughly the same. Instead, the one with
loop do t = Time.now 1000000.times do begin raise(Exception, '', ) rescue Exception end puts Time.now - t end
loop do t = Time.now 1000000.times do begin e = Exception.new e.set_backtrace() raise e rescue Exception end puts Time.now - t end
There's some logic missing in JRuby to avoid generating a backtrace if one is manually set.