Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6BFF0CED1 for ; Wed, 20 Jun 2012 10:08:45 +0000 (UTC) Received: (qmail 83068 invoked by uid 500); 20 Jun 2012 10:08:44 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 82990 invoked by uid 500); 20 Jun 2012 10:08:44 -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 82956 invoked by uid 99); 20 Jun 2012 10:08:43 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jun 2012 10:08:43 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 15BCE1402B5 for ; Wed, 20 Jun 2012 10:08:43 +0000 (UTC) Date: Wed, 20 Jun 2012 10:08:43 +0000 (UTC) From: "Shai Erera (JIRA)" To: dev@lucene.apache.org Message-ID: <594381509.33388.1340186923092.JavaMail.jiratomcat@issues-vm> In-Reply-To: <2025913505.28704.1340090204339.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (LUCENE-4156) Improve implementation of DirectoryTaxonomyWriter.getSize() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-4156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13397399#comment-13397399 ] Shai Erera commented on LUCENE-4156: ------------------------------------ You're right, 2 extra method calls are not worth the defensive code. If we'll change getSize(), I hope that we'll remember to fix getParent too. At any rate, the reason we check the size is for throwing a friendlier exception with text. If someone passes an invalid ordinal, he'll get AIOOBE anyway, just without the text. I'll commit this now. > Improve implementation of DirectoryTaxonomyWriter.getSize() > ----------------------------------------------------------- > > Key: LUCENE-4156 > URL: https://issues.apache.org/jira/browse/LUCENE-4156 > Project: Lucene - Java > Issue Type: Improvement > Components: modules/facet > Reporter: Sivan Yogev > Assignee: Shai Erera > Priority: Minor > Attachments: LUCENE-4156.patch > > > Current implementation of DirectoryTaxonomyWriter.getSize() is synchrionized and invokes indexWriter.maxDoc(), both harming performance. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org