> Le 21 juin 2023 à 18:24, Mark Wielaard <m...@klomp.org> a écrit : > > > > Hi Romain, > > Seeing those performance results I understand why you were suspecting > the linked list data structure used in elf_getdata_rawchunk. > > Would you be able to test a rebuild libelf with the attached patch, > which replaces that datastructure with a binary search tree? > > It didn't really show much speedup locally (in the noise, maybe 0.01 > sec faster on ~0.25 sec run). But if there are more than 2000 calls to > elf_getdata_rawchunk it should make things faster.
Hi Mark, Actually I have spent some time today to reproduce the issue for real, using directly systemd. The details can be found in https://github.com/systemd/systemd/pull/28093 which was just merged. This change in systemd is enough to fix the biggest part of the "slow" parsing of cores. Yet even with my systemd patch, we will still call elf_getdata_rawchunk 2000 times if the crashing process had 2000 shared libraries, so indeed your patch in elfutils might still be welcome. I will test it later when I go home, or tomorrow. Thanks, Romain