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 E74E34C38 for ; Tue, 17 May 2011 09:29:30 +0000 (UTC) Received: (qmail 35595 invoked by uid 500); 17 May 2011 09:29:29 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 35530 invoked by uid 500); 17 May 2011 09:29:29 -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 35523 invoked by uid 99); 17 May 2011 09:29:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 May 2011 09:29:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 May 2011 09:29:27 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 58721CD753 for ; Tue, 17 May 2011 09:28:47 +0000 (UTC) Date: Tue, 17 May 2011 09:28:47 +0000 (UTC) From: "Earwin Burrfoot (JIRA)" To: dev@lucene.apache.org Message-ID: <1867462454.18560.1305624527359.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1276268848.17030.1305584267724.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (LUCENE-3105) String.intern() calls slow down IndexWriter.close() and IndexReader.open() for index with large number of unique field names MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-3105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13034640#comment-13034640 ] Earwin Burrfoot commented on LUCENE-3105: ----------------------------------------- Hmm.. Ok, it *is* still used, but that's gonna be fixed, mm? > String.intern() calls slow down IndexWriter.close() and IndexReader.open() for index with large number of unique field names > ---------------------------------------------------------------------------------------------------------------------------- > > Key: LUCENE-3105 > URL: https://issues.apache.org/jira/browse/LUCENE-3105 > Project: Lucene - Java > Issue Type: Bug > Components: core/index > Affects Versions: 3.1 > Reporter: Mark Kristensson > Attachments: LUCENE-3105.patch > > > We have one index with several hundred thousand unqiue field names (we're optimistic that Lucene 4.0 is flexible enough to allow us to change our index design...) and found that opening an index writer and closing an index reader results in horribly slow performance on that one index. I have isolated the problem down to the calls to String.intern() that are used to allow for quick string comparisons of field names throughout Lucene. These String.intern() calls are unnecessary and can be replaced with a hashmap lookup. In fact, StringHelper.java has its own hashmap implementation that it uses in conjunction with String.intern(). Rather than using a one-off hashmap, I've elected to use a ConcurrentHashMap in this patch. -- This message is automatically generated by JIRA. 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