PARANOIA_LEVEL
Sandro Santilli
strk at kbt.io
Thu Jan 18 22:04:11 PST 2024
On Thu, Jan 18, 2024 at 03:49:47PM -0800, Paul Ramsey wrote:
> I feel like the most “standard” thing to do would be to convert them all to assert()s and then have a
>
> —enable-assert
>
> option. And then we can add other asserts to our heart’s content without having to know about this weird option Dave invented back in 2004.
Put the blame on me for that weird name (I was being paranoid due to
so many memory errors back then.. it was as we switched to
light-weight-geom)
Enabling assertions shouldn't make the code orders of magnitudes slower
(while being paranoid may?)
The biggest paranoid check is in a block of code which ensures a
GEOMETRYCOLLECTION doesn't have multiple references to the same GEOMETRY.
That one is only activated by PARANOIA_LEVEL > 1 and is likely the
reason why you are seeing orders of magnitude slower operations.
That paranoid check references http://trac.osgeo.org/postgis/ticket/2933
Now that I went looking I see that --enable-debug is making
PARANOIA_LEVEL=10 whereas it is =0 without that switch.
That's basically your problem. Fine tuning actual paranoia level would
fix it:
--with-paranoia-level 1
--with-paranoia-level 2
--with-paranoia-level ...
That said, feel free to unwrap the simple checks out the paranoia
macro but IIRC blocks protected by that are really paranoid ...
--strk;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20240119/695e83bc/attachment.sig>
More information about the postgis-devel
mailing list