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

Set the thread pool size only when the configuration is changed. #1247

Merged
merged 1 commit into from
Jun 17, 2016

Conversation

yanglifan
Copy link
Contributor

This contribution will make Hystrix run faster in JDK 6. Since when create a HystrixCommand, HystrixThreadPoolDefault.touchConfig will be executed, then executeThreadPoolExecutor.setCorePoolSize and ThreadPoolExecutor.setMaximumPoolSize. These two methods will execute mainLock.lock() all the time. That is negative to the performance.

The improve is to check whether pool size will be changed or not before set this value.

This contribution will not affect JDK 7 and 8.

@mattrjacobs
Copy link
Contributor

Thanks, @yanglifan! I agree that the CI failure is unrelated. I'll merge in your PR and then get that unit test addressed

@mattrjacobs mattrjacobs merged commit c86931b into Netflix:master Jun 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants