-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Move expensive WGS84_XY
constant setup into ElevationModule
#5786
Move expensive WGS84_XY
constant setup into ElevationModule
#5786
Conversation
WGS84_XY
constant setup into ElevationModule
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5786 +/- ##
==========================================
Coverage 67.81% 67.81%
- Complexity 16531 16533 +2
==========================================
Files 1906 1906
Lines 72277 72276 -1
Branches 7443 7443
==========================================
Hits 49016 49016
Misses 20740 20740
+ Partials 2521 2520 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good. I proposed a change to the comments:
- The field is private so it's no longer "shared".
- My understanding is that looking up the CRS is not particularly slow, it's the database initialization that's slow, and incurred repeatedly when unrelated tests are run.
- I also combined the two comments into one as a matter of style.
- Removed the link to the PR in favor of summarizing the reasoning directly in the comment. It's a judgement call in each case, but in this case the motivation outlined in the PR can be expressed in about the same space as a link, and it is generally possible to trace a commit back to the PR in the unlikely case that further detail is needed.
src/main/java/org/opentripplanner/graph_builder/module/ned/ElevationModule.java
Outdated
Show resolved
Hide resolved
…vationModule.java Co-authored-by: Andrew Byrd <[email protected]>
Summary
When profiling something else, I noticed during test setup
GeometryUtils
takes up to 500ms to initialize. That is because it does quite an expensive lookup of a coordinate reference system in a HSQL embedded database.Why is this bad?
I strive to write tests that execute quite quickly so having 500ms startup time for a test is a reason for me to investigate. If I move the initialization into
ElevationModule
investigating slow tests will be less noisy.