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

Performance regression between RC1 and latest snapshots with large amount of configuration properties #21416

Closed
dreis2211 opened this issue May 12, 2020 · 8 comments
Assignees
Labels
theme: performance Issues related to general performance type: regression A regression from a previous release
Milestone

Comments

@dreis2211
Copy link
Contributor

Hi,

after opening #21394 I thought I ran some benchmarks again on a project with a large amount of configuration properties. We've used https://github.com/martinvisser/config-properties-example in the past for this.

When doing so, I get the following results:

RC1 Snapshot
5.218 5.639
5.737 5.917
5.417 5.696
5.439 5.739
5.111 5.786
5.133 5.854
5.134 5.677
5.335 6.680
5.227 6.011
5.250 5.778
Mean 5.300 5.878
Range 0.626 1.041

As you can see, the latest snapshot is about half a second slower than RC1. I'm not quite sure yet if this can be only traced back to the new hashCode calculation that was introduced in #20625, so I thought I better open an issue to investigate.

Cheers,
Christoph

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 12, 2020
@dreis2211
Copy link
Contributor Author

After #21394 was merged I see roughly the same numbers, so it didn't really improve things.

@dreis2211
Copy link
Contributor Author

dreis2211 commented May 12, 2020

Further investigation shows the following differences between RC1 and current snapshot builds:
image
This seems to be related to b4963d2 or the work done in #20625 or a combination of both. But I can't pinpoint it, yet.

@philwebb philwebb added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged labels May 12, 2020
@philwebb philwebb added this to the 2.3.0 milestone May 12, 2020
@philwebb
Copy link
Member

Thanks for spotting this.

@philwebb philwebb self-assigned this May 12, 2020
@philwebb philwebb added the theme: performance Issues related to general performance label May 12, 2020
philwebb added a commit that referenced this issue May 13, 2020
Attempt to improve the performance of the `ConfigurationPropertySource`
adapters `containsDescendantOf` method. The method now operates on
arrays rather than iterators and reduces the inner for-loop when
possible.

See gh-21416
@philwebb
Copy link
Member

@dreis2211 I've pushed something that I think will make a difference. Could you try your sample app again and see if things have improved?

@dreis2211
Copy link
Contributor Author

@philwebb We're good. It's even better than in 2.2.7 now. Thanks a lot.

RC1 Snapshot
5.641 4.242
6.445 4.123
5.592 4.270
6.138 4.537
5.471 4.185
5.846 4.149
6.517 4.206
6.522 4.198
5.442 4.187
5.664 4.164
Mean 5.928 4.226
Range 1.080 0.414
2.3.0 2.2.7
4.314 5.196
4.016 5.895
4.195 6.808
4.117 6.681
4.229 6.490
4.102 6.702
4.080 6.766
4.025 6.771
4.084 6.563
4.082 6.223
Mean 4.124 6.409
Range 0.298 1.612

@mbhave
Copy link
Contributor

mbhave commented May 13, 2020

@dreis2211 Out of curiosity, did you do a local build to get the latest snapshot? Asking because I don't think repo.spring.io has this change yet due to a failed build.

@dreis2211
Copy link
Contributor Author

I did, @mbhave

@mbhave
Copy link
Contributor

mbhave commented May 13, 2020

thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: performance Issues related to general performance type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

4 participants