Return-Path: Delivered-To: apmail-lucene-ruby-dev-archive@www.apache.org Received: (qmail 86894 invoked from network); 26 Nov 2008 17:08:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Nov 2008 17:08:36 -0000 Received: (qmail 36095 invoked by uid 500); 26 Nov 2008 17:08:47 -0000 Delivered-To: apmail-lucene-ruby-dev-archive@lucene.apache.org Received: (qmail 36013 invoked by uid 500); 26 Nov 2008 17:08:47 -0000 Mailing-List: contact ruby-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ruby-dev@lucene.apache.org Delivered-To: mailing list ruby-dev@lucene.apache.org Received: (qmail 36002 invoked by uid 99); 26 Nov 2008 17:08:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Nov 2008 09:08:47 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of goodieboy@gmail.com designates 209.85.217.10 as permitted sender) Received: from [209.85.217.10] (HELO mail-gx0-f10.google.com) (209.85.217.10) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Nov 2008 17:07:22 +0000 Received: by gxk3 with SMTP id 3so807157gxk.5 for ; Wed, 26 Nov 2008 09:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=+dBWdQpd+y1Tcbt4hnyItMT3C874TJWEu0L6CoG9Mrc=; b=HVTG6almHz74j5Xu5jsRHHm9NDA4DZgBFqrxN7jhv7QTv/wPSkSgO+KErEMghuwfkV Gjw25FcNh4sPY8QFdhBtJvlb+ZhRTnvGUTQ5nID12atGBsoFaMa58RM/QXnc/EBr1NRu Uk1qzz4++DUe9lg6nGaNzcXZEJBh4qgbW/mvI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=wqFfYiIWYnhMCrSZ/n0o1d9db5/j/OL20nQL0MeSuY2KbUEkJRz0hLwnC9v9BspxBf hCDGb0w6qHIPDiduKwUUL2fdNL7Y58HOowIuT5g6yo5A+BimvIiu4Tcwmu8FVZm4jCs6 ZaepZHsDOvYYIIQHkgMfWXhsYfrY9p+De9Gtk= Received: by 10.142.254.6 with SMTP id b6mr2647298wfi.157.1227719217768; Wed, 26 Nov 2008 09:06:57 -0800 (PST) Received: by 10.142.126.14 with HTTP; Wed, 26 Nov 2008 09:06:57 -0800 (PST) Message-ID: Date: Wed, 26 Nov 2008 12:06:57 -0500 From: "Matt Mitchell" To: ruby-dev@lucene.apache.org Subject: Re: quick jruby + solr benchmarks In-Reply-To: <2CA214F1-2CAE-4DD1-8756-9327799C82D2@ehatchersolutions.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_20661_23444347.1227719217764" References: <2CA214F1-2CAE-4DD1-8756-9327799C82D2@ehatchersolutions.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_20661_23444347.1227719217764 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Interesting. My main goal was to get a feel for how jruby and the direct/embedded stuff compared to mri ruby and straight up http. But obviously, the data and these tests are not realistic at all. Thanks for your feedback guys. Matt On Wed, Nov 26, 2008 at 10:34 AM, Erik Hatcher wrote: > I just had a brief conversation with Yonik on this to get his way more > expert opinion, and it really boils down to this in this particular test... > the query itself is incredibly fast (1 millisecond or less QTime Solr > reports) since there are no documents. So what these differences are > showing is merely the difference between HTTP and a method call - with > nothing else (of note) going on. > > In a realer world scenario, the HTTP overhead makes less difference as the > work being done in the query/faceting overshadows the communication > overhead. > > There's lies, damned lies, and benchmarks :) > > Erik > > > > On Nov 26, 2008, at 9:54 AM, Matt Mitchell wrote: > > Yeah I overlooked all of that. Thanks Erik. So could a better query test >> be >> an incremental one based on id like: >> >> 100.times do |id| >> q = "id:#{id}" >> # query request here... >> end >> >> ? >> >> Would you happen to know why the solr home and data dir never really >> change? >> Anytime I use commons http or embedded, a "solr" directory is created in >> the >> same directory as my script. Even though I'm setting the home and data dir >> in my code? >> >> Matt >> >> On Wed, Nov 26, 2008 at 3:28 AM, Erik Hatcher > >wrote: >> >> just a couple of quick code comments... >>> >>> On Nov 25, 2008, at 6:04 PM, Matt Mitchell wrote: >>> >>> # EmbeddedSolrServer >>>> def embedded(solr_home) >>>> @embedded ||= ( >>>> import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer >>>> import org.apache.solr.core.CoreContainer >>>> import org.apache.solr.core.CoreDescriptor >>>> import org.apache.solr.client.solrj.SolrQuery >>>> core_name = 'main-core' >>>> container = CoreContainer.new >>>> descriptor = CoreDescriptor.new(container, core_name, solr_home) >>>> core = container.create(descriptor) >>>> >>>> >>> You'll want to close that core, otherwise the JVM doesn't exit. I >>> changed >>> this to: >>> >>> @core = .... >>> >>> container.register(core_name, core, false) >>> >>>> >>>> >>> and used @core there. >>> >>> query = {'qt' => 'standard', 'q'=>'ipod', 'facet.field' => 'cat'} >>> >>>> >>>> >>> Note that faceting is not enabled unless there is also a &facet=on >>> >>> params = hash_to_params(query) >>> >>>> >>>> max = 1000 >>>> >>>> Benchmark.bm do |x| >>>> x.report 'http commons' do >>>> max.times do >>>> http_commons.query(params) >>>> end >>>> end >>>> x.report 'embedded' do >>>> max.times do >>>> embedded(solr_home).query(params) >>>> end >>>> end >>>> end >>>> >>>> >>> And I added an: >>> >>> @core.close >>> >>> at the end. >>> >>> Erik >>> >>> >>> > ------=_Part_20661_23444347.1227719217764--