[ 
https://issues.apache.org/jira/browse/SOLR-122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12468140
 ] 

Coda Hale commented on SOLR-122:
--------------------------------

So I just ran two tests: indexing and querying. The first was indexing about 
251K records (mostly short strings, floats, and integers), 1K at a time (the 
server was stopped and the index deleted between these tests). The second was 
querying ("id:[1 TO 1000]") and returning 100 rows. These tests were run on my 
MacBook Pro while I checked my mail and looked at funny pictures of cats. Solr 
was running on Jetty, with the config from the solrb directory, but a different 
schema.

So... libxml-ruby is much faster:

                        user     system       total         real
REXML indexing:  2107.480000  24.760000 2132.240000 (2421.141147)
libxml indexing:  728.810000  24.440000  753.250000 (1016.763167)

REXML querying:    25.520000   7.210000   32.730000  (873.637089)
libxml querying:   19.790000   6.020000   25.810000  (706.032189)

(For those unfamiliar with Ruby benchmarks, the first three numbers are 
CPU-seconds, the last number in parentheses is the actual elapsed clock time in 
seconds.)

Just to clarify, I'm not suggesting that REXML be ditched entirely; rather, I 
think it would be better to have a drop-in replacement for people who want to 
use libxml (or Xaagly or whatever) in situations where performance is important.

Also, my previous file had an escaping bug, so I'll post a corrected version. 
(Basically, one should use XML::Node#<< instead of passing a second parameter 
to XML::Node.new when setting the content of an element to an unescaped value.)

> Add optional support for Ruby-libxml2 (vs. REXML)
> -------------------------------------------------
>
>                 Key: SOLR-122
>                 URL: https://issues.apache.org/jira/browse/SOLR-122
>             Project: Solr
>          Issue Type: Improvement
>          Components: clients - ruby - flare
>            Reporter: Coda Hale
>         Attachments: libxml.rb, libxml.rb
>
>
> This file adds drop-in support for the ruby-libxml2, which is a wrapper for 
> the libxml2 library, which is an order of magnitude or so faster than REXML.
> This depends on my SOLR-121 patch for multi-document adds, since the behavior 
> of Solr::Request::AddDocument#to_s is different.
> Requiring this makes some tests fail, but for trivial reasons: some tests are 
> directly tied to REXML, others fail due to interelement whitespace added by 
> libxml2 (which you can't disable via the Ruby interface). Functionally, it's 
> identical, and passes all functional tests.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to