Opened 11 years ago

Closed 11 years ago

#2494 closed patch (fixed)

Avoid unnecessary memory copy in gserialized_datum_get_box2df_p

Reported by: hayamiz Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.5
Component: postgis Version: 2.0.x
Keywords: Cc:

Description

In gserialized_datum_get_box2df_p, PG_DETOAST_DATUM_SLICE is always called for obtaining header section of the gserialized datum. PG_DETOAST_DATUM_SLICE always performs memory allocation and copy, but such memory operations are not necessary when the datum is not extended( not external nor compressed ).

This patch removes such extra memory operations. In case of non-external and non-compressed geometry data, PG_DETOAST_DATUM is used instead of _SLICE. For external or compressed (typically large) geometry data, PG_DETOAST_DATUM_SLICE is still used not to copy whole objects.

Attachments (1)

0001-avoid-detoast-slicing-if-datum-is-not-extended.patch (1.2 KB ) - added by hayamiz 11 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by pramsey, 11 years ago

Milestone: PostGIS 2.0.5

comment:2 by pramsey, 11 years ago

I've applied this to trunk @ r12042 (thanks!) to see if any negative consequences fall out. If not, I'll apply back to 2.1 and 2.0

comment:3 by pramsey, 11 years ago

Resolution: fixed
Status: newclosed

r12132 in 2.1

r12133 in 2.0

Note: See TracTickets for help on using tickets.