From 5e8b1a9688471e0510f2d047305f24a643761d0c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ra=C3=BAl=20Mar=C3=ADn=20Rodr=C3=ADguez?= Date: Wed, 19 Jun 2019 15:15:34 +0000 Subject: [PATCH] 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 git-svn-id: http://svn.osgeo.org/postgis/trunk@17542 b70326c6-7e19-0410-871a-916f4a2858ee --- libpgcommon/lwgeom_cache.h | 2 +- libpgcommon/lwgeom_transform.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libpgcommon/lwgeom_cache.h b/libpgcommon/lwgeom_cache.h index b6ccc25a7..034e494c5 100644 --- a/libpgcommon/lwgeom_cache.h +++ b/libpgcommon/lwgeom_cache.h @@ -73,7 +73,7 @@ typedef struct struct_PROJSRSCacheItem 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 diff --git a/libpgcommon/lwgeom_transform.c b/libpgcommon/lwgeom_transform.c index f5a612a1e..c65d29d0b 100644 --- a/libpgcommon/lwgeom_transform.c +++ b/libpgcommon/lwgeom_transform.c @@ -40,15 +40,13 @@ */ 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 -- 2.50.1