Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 61701 invoked from network); 22 Oct 2010 22:45:45 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Oct 2010 22:45:45 -0000 Received: (qmail 79028 invoked by uid 500); 22 Oct 2010 22:45:44 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 78981 invoked by uid 500); 22 Oct 2010 22:45: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 78974 invoked by uid 99); 22 Oct 2010 22:45:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Oct 2010 22:45:44 +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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Oct 2010 22:45:42 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o9MMjKSu018506 for ; Fri, 22 Oct 2010 22:45:20 GMT Message-ID: <3430222.36251287787520157.JavaMail.jira@thor> Date: Fri, 22 Oct 2010 18:45:20 -0400 (EDT) From: "Yonik Seeley (JIRA)" To: dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-2719) Re-add SorterTemplate and use it to provide fast ArraySorting and replace BytesRefHash sorting In-Reply-To: <1211226.35421287783980267.JavaMail.jira@thor> 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-2719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924068#action_12924068 ] Yonik Seeley commented on LUCENE-2719: -------------------------------------- bq. This also applies to Solr (Yonik?). Yep - Solr also has it's own version of quicksort - PrimUtils.sort() to deal with sorting indexes (an int[]) instead of objects (parallel array sorting). > Re-add SorterTemplate and use it to provide fast ArraySorting and replace BytesRefHash sorting > ---------------------------------------------------------------------------------------------- > > Key: LUCENE-2719 > URL: https://issues.apache.org/jira/browse/LUCENE-2719 > Project: Lucene - Java > Issue Type: Improvement > Affects Versions: 3.1 > Reporter: Uwe Schindler > Assignee: Uwe Schindler > Fix For: 3.1, 4.0 > > Attachments: LUCENE-2719.patch > > > This patch adds back an optimized and rewritten SorterTemplate back to Lucene (removed after release of 3.0). It is of use for several components: > - Automaton: Automaton needs to sort States and other things. Using Arrays.sort() is slow, because it clones internally to ensure stable search. This component is much faster. This patch adds Arrays.sort() replacements in ArrayUtil that work with natural order or using a Comparator. You can choose between quickSort and mergeSort. > - BytesRefHash uses another QuickSort algorithm without insertionSort for very short ord arrays. This class uses SorterTemplate to provide the same with insertionSort fallback in a very elegant way. Ideally this class can be used everywhere, where the sort algorithm needs to be separated from the underlying data and you can implement a swap() and compare() function (that get slot numbers instead of real values). This also applies to Solr (Yonik?). > SorterTemplate provides quickSort and mergeSort algorithms. Internally for short arrays, it automatically chooses insertionSort (like JDK's Arrays). The quickSort algorith was copied modified from old BytesRefHash. This new class only shares MergeSort with the original CGLIB SorterTemplate, which is no longer maintained. -- 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: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org