New submission from Ian H <insertinterestingnameh...@gmail.com>:

While working on another project I noticed that there's a cache of shared 
object handles kept inside _PyImport_FindSharedFuncptr. See 
https://github.com/python/cpython/blob/b2b6cd00c6329426fc3b34700f2e22155b44168c/Python/dynload_shlib.c#L51-L55.
 It appears to be an optimization to work around poor caching of shared object 
handles in old libc implementations. After some testing, I have been unable to 
find any meaningful performance difference from this cache, so I propose we 
remove it to save the space.

My initial tests were on Linux (Ubuntu 18.04). I saw no discernible difference 
in the time for running the Python test suite with a single thread. Running the 
test suite using a single thread shows a lot of variance, but after running 
with and without the cache 40 times the mean times with/without the cache was 
nearly the same. Interpreter startup time also appears to be unaffected. This 
was all with a debug build, so I'm in the process of collecting data with a 
release build to see if that changes anything.

----------
messages: 391453
nosy: Ian.H
priority: normal
severity: normal
status: open
title: Unnecessary Cache of Shared Object Handles
versions: Python 3.10

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43895>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to