[Xapian-devel] PHP Latest
Daniel Ménard
Daniel.Menard at Bdsp.tm.fr
Fri Apr 21 12:15:15 BST 2006
Olly Betts a écrit :
>I just tested this with the latest version (8) and I don't get the lock
>file left behind with a quartz database. However, I don't if I use the
>flat file API either...
>
>
I am not able to reproduce the problem I had, either with Xapian 0.9.4
or 0.9.5, at least with php 5.1.2 under debian. Perhaps I dreamt (too
much cafeine ?) or it can be that the problem only appears under
specific conditions.
However, Sam's points about php destructors not always called all seem
serious, so there can be a latent problem. Having memory leaks under
apache would be a problem, but I don't have the tools required to test.
>OK, another update: (...)
>
>
Ah, this wrapper is getting nicer and nicer from day to day (oups !, I
meant from night to night ;-))
>I've eliminated get_func_args/call_user_func_array in favour of using
>default parameters and switching on func_num_args().
>
>
Sam's suggestion was good : I tested 100000 calls to
QueryParser::parse_query with versions 7 and 8 of the wrapper.
Version 7 : 3.28 sec
Version 8 : 2.64 sec.
(For comparison, calling directly
"queryparser_parse_query($parser->swig_ptr,'word');" : 0.96 sec.)
Passing one or two args does not make a difference.
BTW : in version 7, QueryParser::__construct was wrong, it was calling
"$this->swig_ptr=new_QueryParser($h=null);" but this is corrected in
version 8.
>TODO: Profile to see if switch is slower than "if ... else ..."
>
>
If I rewrite parse_query with an 'if' in version 8 of the wrapper, I
don't measure any difference (exec time=2.64 sec).
>we wish to compare calling the flat functions in the following versions :
>- 0.9.4 release version
>- 0.9.4+patch
>- 0.9.5 release version
>- 0.9.5 release version + patch
>
>
I ran many times case 0 of my test with the different versions
http://www.bdsp.tm.fr/aed/xapian/call_test.php.txt
Exec times I obtained are :
- 0.9.4 release version : 8.84 8.96 9.00 9.01 8.81 8.84 8.80 8.83
- 0.9.4 with xapian_wrap8.cc, commenting all lines wich reference
'set_sort_by_relevance_then_value' : 9.51 9.49 9.53 9.52 9.51
- 0.9.5 release version : 8.81 8.87 8.85 8.85 8.86
- 0.9.5 with xapian_wrap8.cc : 9.38 9.40 9.38 9.33 9.36 9.34
The difference is not very important, but it exists. Is there something
I can do to investigate anymore ?
Oh, and for the fun, I also ran my test with the version 8 of the
wrapper and compared it with my own (old) wrapper.
Of course, the results are the same (14.46 sec), so, thanks to Olly and
Sam, we now have a generated OO wrapper for PHP which is as good as a
hand-made wrapper, with not-so-much overhead (14.46 vs 9.38), and which
will always be up-to-date !
Best regards,
--
Daniel Ménard
Banque de Données Santé Publique
Avenue du Professeur Léon Bernard
35043 Rennes Cédex
Tél. (+33) 2.99.02.29.42
Fax (+33) 2.99.02.26.28
E-mail Daniel.Menard at Bdsp.tm.fr
http://www.bdsp.tm.fr
More information about the Xapian-devel
mailing list