Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 50598 invoked from network); 9 Jun 2010 11:39:49 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Jun 2010 11:39:49 -0000 Received: (qmail 53204 invoked by uid 500); 9 Jun 2010 11:39:48 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 52892 invoked by uid 500); 9 Jun 2010 11:39:46 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 52885 invoked by uid 99); 9 Jun 2010 11:39:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jun 2010 11:39:45 +0000 X-ASF-Spam-Status: No, hits=3.5 required=10.0 tests=AWL,FREEMAIL_FROM,HTML_MESSAGE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cdoronc@gmail.com designates 74.125.82.48 as permitted sender) Received: from [74.125.82.48] (HELO mail-ww0-f48.google.com) (74.125.82.48) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jun 2010 11:39:39 +0000 Received: by wwe15 with SMTP id 15so879490wwe.35 for ; Wed, 09 Jun 2010 04:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=+zm7sToYC7Czn9pv5yj0uTqXAMVDJBDCtvISuPLNffk=; b=QJkqX1cRRQ03+p1x6EEj/RN9Z2YF2XnRYxTa3F1kW4YTZqAC6GoK3ArnzeCrI6bQF5 44TKWf5nL0P4lLat+RI3hup3GXjQHuQtOgRcWYBnwId1gYcTQ9GiogVIrqqVQ8jpV5YS Ae2VVOQKb54XDow9V+pKhsKQZDAl0CZ2SvT2M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=KyyPd/7PYHshU/GjxsCEbZsTROoy29cPTBH4uWcHFbRERoHBQhi8mJ4daJyl0o2EB3 zJMEq/SUhvrYlil8kYG8rP0zgjk0SAHK5zqbvWUCjYAS+1dKT5jm5oCQ8x7kRb5CGNtA t3YZua+yfmBHAKuXATXjYORF0bwCxlW4m69s8= MIME-Version: 1.0 Received: by 10.227.137.143 with SMTP id w15mr1642005wbt.117.1276083557164; Wed, 09 Jun 2010 04:39:17 -0700 (PDT) Received: by 10.216.155.12 with HTTP; Wed, 9 Jun 2010 04:39:17 -0700 (PDT) In-Reply-To: References: Date: Wed, 9 Jun 2010 14:39:17 +0300 Message-ID: Subject: Re: Proposal: Scorer api change From: Doron Cohen To: dev@lucene.apache.org Content-Type: multipart/alternative; boundary=0016368334d220e7780488975b7a --0016368334d220e7780488975b7a Content-Type: text/plain; charset=ISO-8859-1 > > If you can fix a hotspot in Lucene to avoid an extra method call, an > extra add/multiply, etc., you should. Doing so ensures the cost can't > be there. Not doing so means you rely on the JRE to be smart enough, > and it very easily may not be (there are so many variables), and that > also makes Lucene's performance more fragile/env-specific. > > Why take that chance? > Of course, but also subject to considerations of code readability/maintainability/extendability/wrapability. I also don't rely on benchmarks to validate this on a case-by-case > basis; the cost for any single change (like this one) can easily be in > the noise, yet these micro-costs do add up. > > Different rules apply "down low". It's like quantum physics! > I think you'd still not modify a nicely extendible/wrapable API just to avoid the extra call, unless benchmarking shows that the cost is high. I think, besides avoiding method calls, there are compelling reasons > to consider a stronger decoupling of matching & scoring. A Query > really ought to be two separable things -- matching (like Filter) and > scoring. > Agree, this would be nice. (Though it would not help John with the requirement to score arbitrary docs). Doron --0016368334d220e7780488975b7a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
If you can fix a hotspot in Lucene to avoid an extra method call, an
extra add/multiply, etc., you should. =A0Doing so ensures the cost can'= t
be there. =A0Not doing so means you rely on the JRE to be smart enough,
and it very easily may not be (there are so many variables), and that
also makes Lucene's performance more fragile/env-specific.

Why take that chance?

Of course, but also subject = to considerations of code readability/maintainability/extendability/wrapabi= lity.

I think, besides avoiding method calls, there are compelling reasons
to consider a stronger decoupling of matching & scoring. =A0A Query
really ought to be two separable things -- matching (like Filter) and
scoring.

Agree, this would be nice. (Though it wou= ld not help John with the requirement to score arbitrary docs).

Dor= on

--0016368334d220e7780488975b7a--