From dev-return-245769-apmail-lucene-dev-archive=lucene.apache.org@lucene.apache.org Mon May 2 08:36:13 2016 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 B5EAB19708 for ; Mon, 2 May 2016 08:36:13 +0000 (UTC) Received: (qmail 34878 invoked by uid 500); 2 May 2016 08:36:13 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 34812 invoked by uid 500); 2 May 2016 08:36:13 -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 34800 invoked by uid 99); 2 May 2016 08:36:12 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 May 2016 08:36:12 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id CA67B2C14F9 for ; Mon, 2 May 2016 08:36:12 +0000 (UTC) Date: Mon, 2 May 2016 08:36:12 +0000 (UTC) From: "Adrien Grand (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LUCENE-7268) Remove ArrayUtil.timSort? 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-7268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15266228#comment-15266228 ] Adrien Grand commented on LUCENE-7268: -------------------------------------- I did some testing and the difference seems to be due to how our impl in ArrayUtil tries to save memory: it uses a hard-coded {{array.length/64}} as the maximum size of the temporary Object[] that it may use for merging. If it needs less memory than that, it will use this temporary Object[], but for larger merges it will switch to an in-place merge routine that is much slower (the same logic that InPlaceMergeSorter uses). I get the following build times with the patch: || Arrays.sort | 222ms | || ArrayUtil.timSort - max temp storage = array.length | 262ms | || ArrayUtil.timSort - max temp storage = array.length/64 (like in master) | 383ms | || ArrayUtil.timSort - max temp storage = 0 | 444ms | > Remove ArrayUtil.timSort? > ------------------------- > > Key: LUCENE-7268 > URL: https://issues.apache.org/jira/browse/LUCENE-7268 > Project: Lucene - Core > Issue Type: Improvement > Reporter: Robert Muir > Attachments: LUCENE-7268_mods.patch > > > Is there some workload where our timSort is better than the JDK one? Should we just remove ours if its slower? > Not that its a great test, but i switched Polygon2D edge sorting (just the one where it says "sort the edges then build a balanced tree from them") from Arrays.sort to ArrayUtil.timSort and was surprised when performance was much slower for an enormous polygon (http://people.apache.org/~mikemccand/geobench/cleveland.poly.txt.gz) -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org