Switching XPath node sorting to Timsort
I use libxml xpath engine on quite large (and mostly "flat") xml files. It seems that Shellsort, that is used in xmlXPathNodeSetSort is a performance bottleneck for my case. I have read some posts about sorting in libxml in the libxml archive, but I agree that qsort was not the way to go. I experimented with Timsort instead and my results were good for me. For about 10000 nodes, my test was about 5x faster with Timsort, for 1000 nodes about 10% faster, for small data files, the difference was not measurable. * timsort.h: the algorithm, kept in a separate header * xpath.c: plug in the new algorithm in xmlXPathNodeSetSort * Makefile.am: add the header to the EXTRA_DIST * doc/apibuild.py: avoid indexing the new header
parent
73f94c60
Please register or sign in to comment