//elog(NOTICE,"in geomunion");
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1);
+#ifdef PROFILE
+ profstop(PROF_P2G1);
+#endif
+#ifdef PROFILE
+ profstart(PROF_P2G2);
+#endif
g2 = POSTGIS2GEOS(geom2);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G2);
#endif
//elog(NOTICE,"g1=%s",GEOSasText(g1));
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1);
+#ifdef PROFILE
+ profstop(PROF_P2G1);
+#endif
+#ifdef PROFILE
+ profstart(PROF_P2G2);
+#endif
g2 = POSTGIS2GEOS(geom2);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G2);
#endif
#ifdef PROFILE
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1 );
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G1);
#endif
#ifdef PROFILE
#endif
result = GEOS2POSTGIS(g3, lwgeom_ndims(geom1->type) > 2);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
if (result == NULL)
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1 );
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G1);
#endif
#ifdef PROFILE
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1 );
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G1);
#endif
#ifdef PROFILE
//elog(NOTICE,"intersection() START");
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1);
+#ifdef PROFILE
+ profstop(PROF_P2G1);
+#endif
+#ifdef PROFILE
+ profstart(PROF_P2G2);
+#endif
g2 = POSTGIS2GEOS(geom2);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G2);
#endif
//elog(NOTICE," constructed geometrys - calling geos");
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1);
+#ifdef PROFILE
+ profstop(PROF_P2G1);
+#endif
+#ifdef PROFILE
+ profstart(PROF_P2G2);
+#endif
g2 = POSTGIS2GEOS(geom2);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G2);
#endif
#ifdef PROFILE
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G1);
#endif
#ifdef PROFILE
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
geosgeom = POSTGIS2GEOS(geom);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G1);
#endif
#ifdef PROFILE
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G1);
#endif
#ifdef PROFILE
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1);
+#ifdef PROFILE
+ profstop(PROF_P2G1);
+#endif
+#ifdef PROFILE
+ profstart(PROF_P2G2);
+#endif
g2 = POSTGIS2GEOS(geom2);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G2);
#endif
#ifdef PROFILE
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1);
+#ifdef PROFILE
+ profstop(PROF_P2G1);
+#endif
+#ifdef PROFILE
+ profstart(PROF_P2G2);
+#endif
g2 = POSTGIS2GEOS(geom2);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G2);
#endif
#ifdef PROFILE
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1);
+#ifdef PROFILE
+ profstop(PROF_P2G1);
+#endif
+#ifdef PROFILE
+ profstart(PROF_P2G2);
+#endif
g2 = POSTGIS2GEOS(geom2);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G2);
#endif
#ifdef PROFILE
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1);
+#ifdef PROFILE
+ profstop(PROF_P2G1);
+#endif
+#ifdef PROFILE
+ profstart(PROF_P2G2);
+#endif
g2 = POSTGIS2GEOS(geom2);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G2);
#endif
#ifdef PROFILE
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1 );
+#ifdef PROFILE
+ profstop(PROF_P2G1);
+#endif
+#ifdef PROFILE
+ profstart(PROF_P2G2);
+#endif
g2 = POSTGIS2GEOS(geom2 );
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G2);
#endif
#ifdef PROFILE
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1 );
+#ifdef PROFILE
+ profstop(PROF_P2G1);
+#endif
+#ifdef PROFILE
+ profstart(PROF_P2G2);
+#endif
g2 = POSTGIS2GEOS(geom2 );
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G2);
#endif
#ifdef PROFILE
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1);
+#ifdef PROFILE
+ profstop(PROF_P2G1);
+#endif
+#ifdef PROFILE
+ profstart(PROF_P2G2);
+#endif
g2 = POSTGIS2GEOS(geom2);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G2);
#endif
#ifdef PROFILE
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1);
+#ifdef PROFILE
+ profstop(PROF_P2G1);
+#endif
+#ifdef PROFILE
+ profstart(PROF_P2G2);
+#endif
g2 = POSTGIS2GEOS(geom2);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G2);
#endif
patt = DatumGetCString(DirectFunctionCall1(textout,
//elog(NOTICE,"GEOS init()");
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1 );
+#ifdef PROFILE
+ profstop(PROF_P2G1);
+#endif
+#ifdef PROFILE
+ profstart(PROF_P2G2);
+#endif
g2 = POSTGIS2GEOS(geom2 );
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G2);
#endif
//elog(NOTICE,"constructed geometries ");
initGEOS(MAXIMUM_ALIGNOF);
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom1);
+#ifdef PROFILE
+ profstop(PROF_P2G1);
+#endif
+#ifdef PROFILE
+ profstart(PROF_P2G2);
+#endif
g2 = POSTGIS2GEOS(geom2);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G2);
#endif
#ifdef PROFILE
//elog(NOTICE,"GEOS init()");
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom);
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G1);
#endif
#ifdef PROFILE
//elog(NOTICE,"GEOS init()");
#ifdef PROFILE
- profstart(PROF_P2G);
+ profstart(PROF_P2G1);
#endif
g1 = POSTGIS2GEOS(geom );
#ifdef PROFILE
- profstop(PROF_P2G);
+ profstop(PROF_P2G1);
#endif
#ifdef PROFILE
#ifdef PROFILE
#include <sys/time.h>
-#define PROF_P2G 0
-#define PROF_G2P 1
-#define PROF_GRUN 2
-#define PROF_QRUN 3
-struct timeval profstart[4], profstop[4];
-long proftime[4];
-long profipts, profopts;
+#define PROF_P2G1 0
+#define PROF_P2G2 1
+#define PROF_G2P 2
+#define PROF_GRUN 3
+#define PROF_QRUN 4
+struct timeval profstart[5], profstop[5];
+long proftime[5];
+long profipts1, profipts2, profopts;
#define profstart(x) do { gettimeofday(&(profstart[x]), NULL); } while (0);
#define profstop(x) do { gettimeofday(&(profstop[x]), NULL); \
proftime[x] = ( profstop[x].tv_sec*1000000+profstop[x].tv_usec) - \
( profstart[x].tv_sec*1000000+profstart[x].tv_usec); \
} while (0);
-#define profreport(n, x, y, r) do { \
- profipts = 0; \
- if ((x)) profipts += lwgeom_npoints(SERIALIZED_FORM((x))); \
- if ((y)) profipts += lwgeom_npoints(SERIALIZED_FORM((y))); \
- if ((r)) profopts = lwgeom_npoints(SERIALIZED_FORM((r))); \
- else profopts = 0; \
- long int conv = proftime[PROF_P2G]+proftime[PROF_G2P]; \
+#define profreport(n, i1, i2, o) do { \
+ profipts1 = profipts2 = profopts = 0; \
+ if ((i1)) profipts1 += lwgeom_npoints(SERIALIZED_FORM((i1))); \
+ else proftime[PROF_P2G1] = 0; \
+ if ((i2)) profipts2 += lwgeom_npoints(SERIALIZED_FORM((i2))); \
+ else proftime[PROF_P2G2] = 0; \
+ if ((o)) profopts += lwgeom_npoints(SERIALIZED_FORM((o))); \
+ else proftime[PROF_G2P] = 0; \
+ long int conv = proftime[PROF_P2G1]+proftime[PROF_P2G2]+proftime[PROF_G2P]; \
long int run = proftime[PROF_GRUN]; \
long int qrun = proftime[PROF_QRUN]; \
long int tot = qrun; \
int convpercent = round(((double)conv/(double)tot)*100); \
int runpercent = round(((double)run/(double)tot)*100); \
elog(NOTICE, \
- "PROF_DET(%s): npts:%lu+%lu=%lu cnv:%lu+%lu run:%lu gtot:%lu qtot:%lu", \
+ "PRF(%s) ipt1 %lu ipt2 %lu opt %lu p2g1 %lu p2g2 %lu g2p %lu grun %lu qrun %lu perc %d%%", \
(n), \
- profipts, profopts, profipts+profopts, \
- proftime[PROF_P2G], proftime[PROF_G2P], \
+ profipts1, profipts2, profopts, \
+ proftime[PROF_P2G1], proftime[PROF_P2G2], \
+ proftime[PROF_G2P], \
proftime[PROF_GRUN], \
- proftime[PROF_P2G]+proftime[PROF_G2P]+proftime[PROF_GRUN], \
- proftime[PROF_QRUN]); \
- elog(NOTICE, "PROF_SUM(%s): pts %lu cnv %d%% grun %d%% tot %d%%", \
- (n), \
- profipts+profopts, \
- convpercent, \
- runpercent, \
- convpercent+runpercent); \
+ proftime[PROF_QRUN], \
+ runpercent+convpercent); \
} while (0);
#endif // PROFILE