[sword-devel] Search optimized (still too slow)
Thu, 8 Apr 2004 15:59:44 +0200
-----BEGIN PGP SIGNED MESSAGE-----
I spent some time to optimize the search in CVS.
The problem is/was for example the extensive the use of XMLTag in the filters,
I tried to avoid them in the filters where it was possible without having to
I also used SWBuf::append directly where SWBuf::operator+ was used before.
I see some good chances where we can optimize:
-Using XMLTag as few as possible
-Change copy constructor of SWBuf to implicit sharing, we have lots of SWBuf
copy-constructor calls I think
-optimize SWBuf::append(char), maybe we can tweak the memory allocation to
alloc larger blocks but more seldom. the append(char) function gets called
more than any other function in a search
But the best solution would be to parse the text only once and then do the
right stuff with it. ATM each filter parses the text again which will make
modules with lot's of filters slow (e.g. KJV).
I got these results (with debug code and profiling code included):
I have not yet committed, because I have to make sure the code doesn't have
some untested bugs.
<>< Re: deemed!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
-----END PGP SIGNATURE-----