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
Cache getSRSbySRID #557
Cache getSRSbySRID #557
Conversation
It was never used and amounted to 90% of the time
Since we are here, cache also getSRIDbySRS for a 40x in ST_GeomfromGeoJSON (or the equivalent '{}'::geometry):
|
a308c29
to
0f41fc9
Compare
|
||
PG_FREE_IF_COPY(geom, 0); | ||
PG_RETURN_TEXT_P(geojson); | ||
PG_RETURN_TEXT_P(lwgeom_to_geojson(lwgeom, srs, precision, output_bbox)); |
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.
lwgeom_free(lwgeom); ?
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.
Probably okay since we're just before leaving a function and context is going to die anyway, but I nervously rechecked it's in postgis/ and not lwgeom/.
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.
Anything except index support functions you get the free "deallocation on exit".
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.
Yes, I've been doing this lately in multiple postgis functions (the ones were liblwgeom now returns a lwvarlena_t object). I think it keeps things cleaner and it's good for performance as it's faster to wait for the deallocation of the context.
Trac: https://trac.osgeo.org/postgis/ticket/4672
For ST_AsX3D remove it altogether since it was never part of the output (so no point on calculating it and passing through functions).
Measurements: