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.
The FailoverSwitchPoint invalidator implements an invalidator that will eventually give up and always be failed. This is to reduce the overhead from global variables that are continually updated and read during the lifetime of the application.
The logic currently uses a synchronized method to do the update of the failure count and the invalidation of the existing switchpoint. As reported by @guizmaii on Gitter, some applications may see this contention in lock profiling if they are updating global variables frequently.
This invalidator is also used for invalidating the base Fixnum and Float methods, but generally I would not expect an application to be continuously redefining math operations.
I have requested that @guizmaii try to determine why global variables are being updated so much in his application, which embeds JRuby into a larger app.
I have an atomics-based improvement for FailoverSwitchPointInvalidator in progress.
Instead of locking around updates to the switchpoint and failure
count, this patch replaces those fields with a stamped atomic
reference that can update both atomically.
Fixesjruby#5525.
The FailoverSwitchPoint invalidator implements an invalidator that will eventually give up and always be failed. This is to reduce the overhead from global variables that are continually updated and read during the lifetime of the application.
The logic currently uses a synchronized method to do the update of the failure count and the invalidation of the existing switchpoint. As reported by @guizmaii on Gitter, some applications may see this contention in lock profiling if they are updating global variables frequently.
This invalidator is also used for invalidating the base Fixnum and Float methods, but generally I would not expect an application to be continuously redefining math operations.
I have requested that @guizmaii try to determine why global variables are being updated so much in his application, which embeds JRuby into a larger app.
I have an atomics-based improvement for FailoverSwitchPointInvalidator in progress.
Here's a result of a script updating the same global across many threads. The profiler I'm using is from https://github.com/jvm-profiling-tools/async-profiler.
Script:
Top lock contention:
The text was updated successfully, but these errors were encountered: