Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 42327 invoked from network); 3 Oct 2009 00:30:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Oct 2009 00:30:50 -0000 Received: (qmail 92398 invoked by uid 500); 3 Oct 2009 00:30:49 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 92322 invoked by uid 500); 3 Oct 2009 00:30:48 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 92264 invoked by uid 99); 3 Oct 2009 00:30:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Oct 2009 00:30:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Oct 2009 00:30:45 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 95123234C498 for ; Fri, 2 Oct 2009 17:30:24 -0700 (PDT) Message-ID: <1996495608.1254529824609.JavaMail.jira@brutus> Date: Fri, 2 Oct 2009 17:30:24 -0700 (PDT) From: "Mark Miller (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Issue Comment Edited: (LUCENE-1257) Port to Java5 In-Reply-To: <926927359.1207125024848.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1257?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D127= 61785#action_12761785 ]=20 Mark Miller edited comment on LUCENE-1257 at 10/2/09 5:30 PM: -------------------------------------------------------------- {quote}Actually I patched the Snowball stemmer code to get ridth of the use= of reflection. So what we use is an altered version of their code. I tried= to get Dr Porter to commit those changes for years but it's still the same= . Based on this I think we could just keep going with our own stuff in ther= e as long we keep a record of what we have done in case we want to merge wi= th their trunk. {quote} Okay - lets do it then. Testing the English version, its actually almost tw= ice as fast with a StringBuilder. I bet it would be almost twice as fast or better again if we could get rid = of that nasty reflection ... *edit* Wait ... do you mean you got rid of some of the reflection or did we lose y= our changes? I'm seeing some nasty slow reflection in there still ... *edit* err... looks like perhaps its only hit once though and then reused.. maybe = not so nasty. My first time looking at this code, so I'm sure you can clear= it up ... was (Author: markrmiller@gmail.com): {quote}Actually I patched the Snowball stemmer code to get ridth of the= use of reflection. So what we use is an altered version of their code. I t= ried to get Dr Porter to commit those changes for years but it's still the = same. Based on this I think we could just keep going with our own stuff in = there as long we keep a record of what we have done in case we want to merg= e with their trunk. {quote} Okay - lets do it then. Testing the English version, its actually almost tw= ice as fast with a StringBuilder. I bet it would be almost twice as fast or better again if we could get rid = of that nasty reflection ... *edit* Wait ... do you mean you got rid of some of the reflection or did we lose y= our changes? I'm seeing some nasty slow reflection in there still ... =20 > Port to Java5 > ------------- > > Key: LUCENE-1257 > URL: https://issues.apache.org/jira/browse/LUCENE-1257 > Project: Lucene - Java > Issue Type: Improvement > Components: Analysis, Examples, Index, Other, Query/Scoring, Que= ryParser, Search, Store, Term Vectors > Affects Versions: 2.3.1 > Reporter: C=C3=A9dric Champeau > Assignee: Uwe Schindler > Priority: Minor > Fix For: 3.0 > > Attachments: java5.patch, LUCENE-1257-Document.patch, LUCENE-1257= -StringBuffer.patch, LUCENE-1257-StringBuffer.patch, LUCENE-1257-StringBuff= er.patch > > > For my needs I've updated Lucene so that it uses Java 5 constructs. I kno= w Java 5 migration had been planned for 2.1 someday in the past, but don't = know when it is planned now. This patch against the trunk includes : > - most obvious generics usage (there are tons of usages of sets, ... Thos= e which are commonly used have been generified) > - PriorityQueue generification > - replacement of indexed for loops with for each constructs > - removal of unnececessary unboxing > The code is to my opinion much more readable with those features (you act= ually *know* what is stored in collections reading the code, without the ne= ed to lookup for field definitions everytime) and it simplifies many algori= thms. > Note that this patch also includes an interface for the Query class. This= has been done for my company's needs for building custom Query classes whi= ch add some behaviour to the base Lucene queries. It prevents multiple unnn= ecessary casts. I know this introduction is not wanted by the team, but it = really makes our developments easier to maintain. If you don't want to use = this, replace all /Queriable/ calls with standard /Query/. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org