[postgis-tickets] r17542 - Increase size of internal PROJ cache

Raul raul at rmr.ninja
Wed Jun 19 08:15:34 PDT 2019


Author: algunenano
Date: 2019-06-19 08:15:34 -0700 (Wed, 19 Jun 2019)
New Revision: 17542

Modified:
   trunk/libpgcommon/lwgeom_cache.h
   trunk/libpgcommon/lwgeom_transform.c
Log:
Increase size of internal PROJ cache

Creating PROJ projections is specially slow for PROJ6, so
we want to avoid recalculating them as much as possible

This is specially important for ST_Buffer(geography) since
it decides the SRID, and thus the projection, dinamically
based on the geometry position around the globe.

References #4372


Modified: trunk/libpgcommon/lwgeom_cache.h
===================================================================
--- trunk/libpgcommon/lwgeom_cache.h	2019-06-19 15:12:21 UTC (rev 17541)
+++ trunk/libpgcommon/lwgeom_cache.h	2019-06-19 15:15:34 UTC (rev 17542)
@@ -73,7 +73,7 @@
 PROJSRSCacheItem;
 
 /* PROJ 4 lookup transaction cache methods */
-#define PROJ_CACHE_ITEMS	8
+#define PROJ_CACHE_ITEMS 128
 
 /*
 * The proj4 cache holds a fixed number of reprojection

Modified: trunk/libpgcommon/lwgeom_transform.c
===================================================================
--- trunk/libpgcommon/lwgeom_transform.c	2019-06-19 15:12:21 UTC (rev 17541)
+++ trunk/libpgcommon/lwgeom_transform.c	2019-06-19 15:15:34 UTC (rev 17542)
@@ -40,16 +40,14 @@
 */
 static char *spatialRefSysSchema = NULL;
 
-
 /*
  * PROJ 4 backend hash table initial hash size
  * (since 16 is the default portal hash table size, and we would
  * typically have 2 entries per portal
- * then we shall use a default size of 32)
+ * then we shall use a default size of 256)
  */
-#define PROJ_BACKEND_HASH_SIZE	32
+#define PROJ_BACKEND_HASH_SIZE 256
 
-
 /**
  * Backend PROJ hash table
  *



More information about the postgis-tickets mailing list