Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 7362 invoked from network); 14 Sep 2010 04:07:02 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Sep 2010 04:07:02 -0000 Received: (qmail 87361 invoked by uid 500); 14 Sep 2010 04:07:01 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 86494 invoked by uid 500); 14 Sep 2010 04:06:58 -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 86482 invoked by uid 99); 14 Sep 2010 04:06:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Sep 2010 04:06:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED,T_FRT_LOLITA1 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; Tue, 14 Sep 2010 04:06:54 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8E46W93009959 for ; Tue, 14 Sep 2010 04:06:33 GMT Message-ID: <21743362.170101284437192755.JavaMail.jira@thor> Date: Tue, 14 Sep 2010 00:06:32 -0400 (EDT) From: "Yonik Seeley (JIRA)" To: dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-2504) sorting performance regression In-Reply-To: <32243998.96151276976723318.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-2504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909107#action_12909107 ] Yonik Seeley commented on LUCENE-2504: -------------------------------------- bq. Yonik, just curious, how do you know what HotSpot is doing? Empirically based on performance numbers? Yeah - it's a best guess based on what I see when performance testing, and matching that up with what I've read in the past. As far as deoptmization is concerned, it's mentioned here: http://java.sun.com/products/hotspot/whitepaper.html, but I haven't read much elsewhere. Specific to this issue, the whole optimization/deoptimization issue is extremely complex. Recall that I reported this: "Median response time in my tests drops from 160 to 102 ms." For simplicity, there are some details I left out: Those numbers were for randomly sorting on different fields (hopefully the most realistic scenario). If you test differently, the results are far different. The first and second test runs measured median time sorting on a single field 100 times in a row, then moving to the next field. Trunk before patch: |unique terms in field|median sort time in ms (first run)|second run |100000|105|168 |10000|105|169 |1000|106|164 |100|127|163 |10|165|197 Trunk after patch: |unique terms in field|median sort time in ms (first run)|second run |100000|85|130 |10000|92|129 |1000|92|126 |100|116|127 |10|117|128 branch_3x |unique terms in field|median sort time in ms (first run)|second run |100000|102|102 |10000|102|103 |1000|101|103 |100|103|103 |10|118|118 So, it seems by running in batches (sorting on the same field over and over), we cause hotspot to overspecialize somehow, and then when we switch things up the resulting deoptimization puts us in a permanently worse condition). branch_3x does not suffer from that, but trunk still does due to the increased amount of indirection. I imagine the differences are also due to the boundaries that the compiler tries to inline/specialize for a certain class. It certainly complicates performance testing, and we need to keep a sharp eye on how we actually test potential improvements. > sorting performance regression > ------------------------------ > > Key: LUCENE-2504 > URL: https://issues.apache.org/jira/browse/LUCENE-2504 > Project: Lucene - Java > Issue Type: Bug > Affects Versions: 4.0 > Reporter: Yonik Seeley > Fix For: 4.0 > > Attachments: LUCENE-2504.patch, LUCENE-2504.patch, LUCENE-2504.zip > > > sorting can be much slower on trunk than branch_3x -- 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