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

Remove locks from StupidPool #1601

Merged
merged 1 commit into from
Aug 6, 2015
Merged

Conversation

drcrallen
Copy link
Contributor

Production systems spend a shocking amount of cpu time in StupidPool.close (on the order of 18%) this is an attempt to reduce that footprint.

Simply looking at the stupidpool stats:
Master: 1.308 ± 0.067 ops/us
This PR: 4.7~5.1 ops/us

This PR is harder to benchmark because it is bound by ObjectResourceHolder and the garbage created that way.

Master is slow enough not to hit that bound.

log.warn("Not closed! Object was[%s]. Allowing gc to prevent leak.", object);
}
super.finalize();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why this wasn't there before?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we need to add it, it should probably be in a finalize block to ensure it gets run no matter what happens

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object.finalize is a no-op in the basic source code. It seemed like a bad idea not to have it present though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in finally block

@xvrl
Copy link
Member

xvrl commented Aug 5, 2015

LGTM, some benchmarks or indication it resolved the issue you were seeing would be good though

@drcrallen drcrallen closed this Aug 6, 2015
@drcrallen drcrallen reopened this Aug 6, 2015
cheddar added a commit that referenced this pull request Aug 6, 2015
@cheddar cheddar merged commit 644253a into apache:master Aug 6, 2015
@drcrallen drcrallen deleted the stupidPoolLockless branch August 6, 2015 18:47
seoeun25 pushed a commit to seoeun25/incubator-druid that referenced this pull request Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants