Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#4614 closed enhancement (fixed)

Optimize stringbuffer_append to avoid strlen calls

Reported by: Algunenano Owned by: Algunenano
Priority: medium Milestone: PostGIS 3.1.0
Component: postgis Version: master
Keywords: Cc:

Description

Related to https://trac.osgeo.org/postgis/ticket/4543

stringbuffer_append is used to output txt (ST_AsText), KML and X3D, and it calculates the length of the string parameter even when the library already knows it (constant or the output of a previous function call).

I plan to add an extra function (stringbuffer_append_len) that allows you to pass the length of the string and simply memcpy's it.

Change History (4)

comment:1 by pramsey, 5 years ago

Resolution: fixed
Status: assignedclosed

comment:2 by Paul Ramsey <pramsey@…>, 5 years ago

In 5304a6f6/git:

Optimize stringbuffer_append to avoid strlen calls, References #4614

comment:3 by Raúl Marín <git@…>, 5 years ago

In 87922037/git:

Optimize stringbuffer_append to avoid strlen calls

References #4614

comment:4 by Algunenano, 5 years ago

With both commits, I'm seeing a 5-6% improvement in ST_AsText (670.234 ms -> 637.996 ms)

Note: See TracTickets for help on using tickets.