OS : Windows Vista
GCC Version 4.5.2
I use tsearch() on Windows and Linux. Performance is really not the same (tsearch() on Linux is infinitely faster).
I looked at the sources, and found that the implementation of tsearch MinGW is an unbalanced tree ...
I replaced the file 'tsearch.c', 'tfind.c', 'tdelete.c' and 'twalk.c' in 'mingwrt-3.18/mingwex' by the version of glibc, with some modifications, and this greatly improved performance (attachement inclued).
Log in to post a comment.