Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache DecimalFormatSymbols instances to reduce lock contention #1414

Merged
merged 1 commit into from Jan 17, 2014

Conversation

@bbrowning
Copy link
Contributor

@bbrowning bbrowning commented Jan 17, 2014

Constructing new DecimalFormatSymbols instances requires locking, and
in some sample Rails apps this contention was bubbling up as a
bottleneck. So, this change caches DecimalFormatSymbols instances
per-thread just like NumberFormat instances are already cached.

The overall throughput in my test application wasn't much changed
because of ActiveRecord's connection mutex still sitting in this way,
but this does get rid of one source of multi-threaded lock contention.

Constructing new DecimalFormatSymbol instances requires locking, and
in some sample Rails apps this contention was bubbling up as a
bottleneck. So, this change caches DecimalFormatSymbol instances
per-thread just like NumberFormat instances are already cached.

The overall throughput in my test application wasn't much changed
because of ActiveRecord's connection mutex still sitting in this way,
but this does get rid of one source of multi-threaded lock contention.
headius added a commit that referenced this pull request Jan 17, 2014
Cache DecimalFormatSymbols instances to reduce lock contention
@headius headius merged commit 716ebbc into jruby:jruby-1_7 Jan 17, 2014
1 check failed
1 check failed
@enebo
default The Travis CI build failed
Details
@enebo enebo added this to the JRuby 1.7.11 milestone Feb 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants