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

Improve performance of StompCommand.getMessageType() [SPR-14636] #19203

Closed
spring-projects-issues opened this issue Aug 28, 2016 · 1 comment
Closed

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Aug 28, 2016

Christoph Dreis opened SPR-14636 and commented

Hey,

I was doing some benchmarks of StompCommand.getMessageType() in order to improve it a bit. While doing so, I noticed that the underlying map of stomp commands can be turned into an EnumMap.

Benchmark Mode Cnt Score Error Units
MyBenchmark.getMessageTypeBefore thrpt 30 163519811,370 ± 8667018,099 ops/s
MyBenchmark.getMessageTypeNew thrpt 30 222591672,767 ± 4476266,088 ops/s

As you can see there is ~36% performance increase.

Cheers,
Christoph


Affects: 4.2.7, 4.3.2

Reference URL: #1148

Issue Links:

  • #19191 Improve performance of assertion in StompSubProtocolHandler

Referenced from: commits aa12288, 899ebd8, 8e98177

Backported to: 4.2.8

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 28, 2016

Christoph Dreis commented

Based on the feedback in the PR i removed the Map completely and achieved the following results:

Benchmark Mode Cnt Score Error Units
MyBenchmark.getMessageTypeBefore thrpt 30 163519811,370 ± 8667018,099 ops/s
MyBenchmark.getMessageTypeNew thrpt 30 222591672,767 ± 4476266,088 ops/s
MyBenchmark.getMessageTypeWithoutMap thrpt 30 344417784,452 ± 3512819,401 ops/s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants