-
Notifications
You must be signed in to change notification settings - Fork 22
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
Don't create duplicate or unnecessary Proj4 objects #54
Comments
Hmmm, there were originally supposed to be separate public entry points where we checked for/created Proj4 instances vs. private implementations where we could assume a Proj4 instance for exactly this purpose. Don't remember what happened with that. |
If we document that the projector API can accept Proj4js.Proj objects, then the caller can pass in those objects instead of the projection strings. But a naive consumer might not realize the performance hit, so maybe caching the Proj4js.Proj objects makes sense. |
The fact that projector uses Proj4 is and should be an implementation detail and I don't believe it's meaningfully beneficial to any public API. This is especially meaningful because Proj4 is not always faster. For example, projector explicitly bypasses it and uses its own routines in the common and mathematically simple case of 4326 <-> 900913 because Proj4 is dramatically slower in that case. |
Renamed this for some clarity. Things that need to happen here:
|
Added Proj4 caching in 708a4df. Big perf. boost:
|
Even better in fc38aae!
|
(Was: Projector performance: handle creating Proj4js.Proj objects better)
Mostly a note so I remember to deal with this.
If you enter the projection cascade (
FeatureCollection
=>Feature
=>...Point
) afterFeatureCollection
, you risk creating a newProj4js.Proj
object twice for every point. Turns out that adds a LOT of overhead.The text was updated successfully, but these errors were encountered: