Message391453
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. |
|
Date |
User |
Action |
Args |
2021-04-20 17:00:51 | Ian.H | set | recipients:
+ Ian.H |
2021-04-20 17:00:51 | Ian.H | set | messageid: <1618938051.55.0.304648722652.issue43895@roundup.psfhosted.org> |
2021-04-20 17:00:51 | Ian.H | link | issue43895 messages |
2021-04-20 17:00:51 | Ian.H | create | |
|