"Fossies" - the Fresh Open Source Software Archive

Member "sphinx-2.2.11-release/test/bench/subtree_cache.xml" (19 Jul 2016, 1406 Bytes) of package /linux/www/sphinx-2.2.11-release.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) XML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <?xml version="1.0" encoding="utf-8"?>
    2 <test>
    3 
    4 <name>subtree caches</name>
    5 
    6 <config>
    7 indexer
    8 {
    9     mem_limit = 512M
   10 }
   11 
   12 searchd
   13 {
   14     <searchd_settings/>
   15     <dynamic>
   16       <variant>
   17         subtree_docs_cache = 256M
   18         subtree_hits_cache = 256M
   19       </variant>
   20       <variant>
   21       </variant>
   22     </dynamic>
   23 }
   24 
   25 source lj
   26 {
   27     type = mysql
   28     <sql_settings sql_db="lj" />
   29 
   30     sql_query = select id, \
   31         uncompress(content) content, \
   32         channel_id \
   33         from posting
   34 
   35     sql_attr_uint = channel_id
   36 }
   37 
   38 index lj
   39 {
   40     source  = lj
   41     path    = <local>data</local>/lj
   42 }
   43 </config>
   44 
   45 <custom_test><![CDATA[
   46 
   47 // in this query cache is harmful and brins slow-down up to 1.5 times
   48 $client->AddQuery('one two 1');
   49 $client->AddQuery('one two 2');
   50 $client->AddQuery('one two 3');
   51 $results = $client->RunQueries();
   52 for ($i = 0; $i < 3; ++$i)
   53     if (is_array($results) && is_array($results[$i]))
   54         unset($results[$i]["time"]);
   55 
   56 // in this query we can see a major speed-up due to using caches
   57 $client->AddQuery("is s" me);
   58 $client->AddQuery("is s" you);
   59 $client->AddQuery("is s" him);
   60 $client->AddQuery("is s" she);
   61 $client->AddQuery("is s" her);
   62 $client->AddQuery("is s" he);
   63 $client->AddQuery("is s" we);
   64 $client->AddQuery("is s" they);
   65 $client->AddQuery("is s" the);
   66 $client->AddQuery("is s" br);
   67 $results = $client->RunQueries();
   68 for ($i = 0; $i < 10; ++$i)
   69     if (is_array($results) && is_array($results[$i]))
   70         unset($results[$i]["time"]);
   71 
   72 ]]></custom_test>
   73 </test>