1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-28 07:21:26 +03:00
Commit Graph

7 Commits

Author SHA1 Message Date
Christopher Swenson
9b987f8c98 Fix timsort invariant loop re: Envisage article
See http://envisage-project.eu/proving-android-java-and-python-sorting-algorithm-is-broken-and-how-to-fix-it/

We use a "runLen" array of size 128, so it should be nearly impossible
to have our implementation overflow.

But in any case, the fix is relatively simple -- checking two extra
conditions in the invariant calculation.

I also took this opportunity to remove some redundancy in the
left/right merge logic in the invariant loop.
2015-02-27 14:55:49 +08:00
Patrick Monnerat
3a76bfedde Portability fix
increase internal use of a portability macro
2013-12-12 15:01:53 +08:00
Daniel Veillard
4ea74a440d Fix a portability issue for GCC < 3.4.0 2012-10-29 10:27:18 +08:00
Daniel Richard
bbe194518f Windows build fixes
Building 2.9.0 on MSVC7.1 was failing

This is because HAVE_CONFIG_H is not #defined
The patch addresses the above, adds testrecurse.exe and the
standard "make check" suite of tests to the MSVC makefile, and also
fixes the following (MSVC7.1) warnings:
buf.c(674) : warning C4028: formal parameter 1 different from
declaration
libxml2\timsort.h(71) : warning C4028: formal parameter 1 different from
declaration
2012-09-18 11:15:06 +08:00
Daniel Veillard
7651606f31 Various cleanups to avoid compiler warnings 2012-09-11 14:02:08 +08:00
Rob Richards
236ea1ea90 fix builds not having stdint.h 2012-08-27 11:56:07 -04:00
Vojtech Fried
3e031b7dae 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
2012-08-24 16:52:44 +08:00