You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JSON::Validator.validate still uses exceptions internally for control flow.
This is a bug as exceptions have performance implications on MRI and dramatic performance implications on JRuby. See this PR for an example of a 9x speedup on JRuby from removing raise/rescue from the hot path in an already highly-optimized library.
I would be happy to start working on fixing this but it seems like a big undertaking and I want to be sure others agree this is worthwhile.
The solution I plan to implement is to make bang methods that wrap non-bang methods and add exceptions, rather than the other way around as is currently implemented.
The text was updated successfully, but these errors were encountered:
Also it might be worth a quick look at #239 where I've tried to clean up
the existing error handling
On Thu, 21 May 2015 at 9:16 pm, Hannes Nevalainen [email protected]
wrote:
JSON::Validator.validate
still uses exceptions internally for control flow.This is a bug as exceptions have performance implications on MRI and dramatic performance implications on JRuby. See this PR for an example of a 9x speedup on JRuby from removing raise/rescue from the hot path in an already highly-optimized library.
I would be happy to start working on fixing this but it seems like a big undertaking and I want to be sure others agree this is worthwhile.
The solution I plan to implement is to make bang methods that wrap non-bang methods and add exceptions, rather than the other way around as is currently implemented.
The text was updated successfully, but these errors were encountered: