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)
Change History (3)
by , 5 years ago
Attachment: | kcg_app_intpt_g0_17594_B-compressor.png added |
---|
comment:2 by , 5 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
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.