Opened 5 years ago

Closed 5 years ago

#951 closed enhancement (invalid)

isNull() performance

Reported by: darkblueb Owned by: strk
Priority: minor Milestone: 3.8.0
Component: Core Version: main
Severity: Unassigned Keywords:
Cc:

Description

during testing using callgrind , the function call costs of geos::geom::Envelope::isNull() indicate that performance may not be good. Due to the number of calls to this function, a closer look may be worthwhile.

BaseOS: Ubuntu Linux Compiler: gcc-8


#!/bin/bash

GEOS_SRC_BASE='/home/user/srcs_live105/geos_gitea'
LD_LIBRARY_PATH='/home/user/srcs_live105/geos_master_cmake/build/lib/'

## C hooks example
#gcc -c -o trace.o trace.c
# CXXFLAGS='-v -Og -ggdb3 -std=c++11 -DUSE_UNSTABLE_GEOS_CPP_API -D_GLIBCXX_PROFILE'

## Callgrind ready ; AVX instructions enabled
CXXFLAGS='-v -O3 -ggdb3 -std=c++11 -march=sandybridge -mtune=sandybridge  -DUSE_UNSTABLE_GEOS_CPP_API'

gcc ${CXXFLAGS} \
  -I${GEOS_SRC_BASE}/include  \
  -I/usr/include/c++/8 -I/usr/include/x86_64-linux-gnu/c++/8 \
  -L/home/user/srcs_live105/geos_master_cmake/build/lib/ \
  InteriorPtArea_app.cpp  \
  -o  app_intpt_O3 \
  -lm -lstdc++ -lpthread  -l:libgeos.so.3.8.0dev

Attachments (1)

kcg_app_intpt_g0_17594_B-compressor.png (100.9 KB ) - added by darkblueb 5 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 by pramsey, 5 years ago

Yeah, moving to stack-allocation means that all the JTS checks on ptr == null end up being function calls in GEOS land. The function is already part of the GEOS inlining code. The only thing my small brain thinks of is an actual boolean member, so that the function call can be replaced with a look at a value instead, at the cost of a little extra memory.

Version 0, edited 5 years ago by pramsey (next)

comment:2 by pramsey, 5 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.