Performance Optimization on getResultSetValue#773
Closed
DR9885 wants to merge 1 commit into
Closed
Conversation
Performance Optimization, using ".equals" is signifigantly slower than "==". When using "BeanPropertyRowMapper", we ran load tests and found significant lack of performance when calling "getColumnValue". I noticed that "getColumnValue" simply just calls "JdbcUtils.getResultSetValue". These tests were run on an table with roughly 70 columns. After making change I ran three tests 1) with existing BeanPropertyRowMapper 2) with optimized BeanPropertyRowMapper 3) with a Custom RowMapper, mapped exactly to the class. Benchmark Results ============= 1) round: 0.38 [+- 0.11], round.block: 0.00 [+- 0.00], round.gc: 0.00 [+- 0.00], GC.calls: 1, GC.time: 0.01, time.total: 7.98, time.warmup: 0.28, time.bench: 7.70 2) round: 0.23 [+- 0.02], round.block: 0.00 [+- 0.00], round.gc: 0.00 [+- 0.00], GC.calls: 0, GC.time: 0.00, time.total: 4.80, time.warmup: 0.22, time.bench: 4.58 3) round: 0.22 [+- 0.02], round.block: 0.00 [+- 0.00], round.gc: 0.00 [+- 0.00], GC.calls: 0, GC.time: 0.00, time.total: 4.62, time.warmup: 0.19, time.bench: 4.43 As you can see the optimized version makes BeanPropertyRowMapper almost as fast as a custom made RowMapper.
Contributor
|
Could you please create a JIRA issue for this one? We have quite a few equals comparisons between Class references in the codebase, so this might be worth revisiting on a wider scale. In any case, a JIRA issue will make sure it doesn't get lost... Juergen |
Author
|
Opened a Ticket: https://jira.spring.io/browse/SPR-12926 |
Contributor
|
This PR can be closed, as the corresponding change was performed for the whole codebase in b4095c3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Performance Optimization, using ".equals" is signifigantly slower than "==".
When using "BeanPropertyRowMapper", we ran load tests and found significant lack of performance when calling "getColumnValue". I noticed that "getColumnValue" simply just calls "JdbcUtils.getResultSetValue". These tests were run on an table with roughly 70 columns.
After making change I ran three tests
Benchmark Results
As you can see the optimized version makes BeanPropertyRowMapper almost as fast as a custom made RowMapper.