[GRASS-git] [OSGeo/grass] 000590: libpython: Speed up grass.lib import by registerin...
Anna Petrasova
noreply at github.com
Tue Jun 30 08:52:33 PDT 2026
Branch: refs/heads/main
Home: https://github.com/OSGeo/grass
Commit: 000590f0b4eb3a331f9841eecc929b31ccfb98e3
https://github.com/OSGeo/grass/commit/000590f0b4eb3a331f9841eecc929b31ccfb98e3
Author: Anna Petrasova <kratochanna at gmail.com>
Date: 2026-06-30 (Tue, 30 Jun 2026)
Changed paths:
M python/libgrass_interface_generator/libgrass__init__.py
Log Message:
-----------
libpython: Speed up grass.lib import by registering $GISBASE/lib (#7605)
Register $GISBASE/lib (where the GRASS shared libraries are installed) with
the ctypes loader before any wrapper module loads its library. The loader
searches these directories first, so it finds the libraries by absolute path
and never reaches its ctypes.util.find_library() fallback. That fallback is
expensive on Linux, where find_library() spawns the toolchain (ldconfig, gcc,
ld, objdump) once per library; for the chain pulled in by grass.temporal that
was about 90 subprocesses and the bulk of the import time. The libraries are
still resolvable through the runtime linker path, so this is a startup
optimization, not a correctness fix; outside a GRASS session GISBASE may be
unset, in which case the loader keeps its original behavior.
To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications
More information about the grass-commit
mailing list