Skip to content

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

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Referenced from: commits aa12288, 899ebd8, 8e98177

Backported to: 4.2.8

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions