Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AA5EE2009C5 for ; Mon, 16 May 2016 10:25:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A9083160A19; Mon, 16 May 2016 08:25:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F2FA11609B0 for ; Mon, 16 May 2016 10:25:13 +0200 (CEST) Received: (qmail 15218 invoked by uid 500); 16 May 2016 08:25:13 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 15207 invoked by uid 99); 16 May 2016 08:25:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 May 2016 08:25:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id E69642C1F58 for ; Mon, 16 May 2016 08:25:12 +0000 (UTC) Date: Mon, 16 May 2016 08:25:12 +0000 (UTC) From: "Philippe Marschall (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LANG-1229) Performance regression due to cyclic hashCode guard MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 16 May 2016 08:25:14 -0000 [ https://issues.apache.org/jira/browse/LANG-1229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15284263#comment-15284263 ] Philippe Marschall commented on LANG-1229: ------------------------------------------ Personally I don't like boolean flags to methods that change the behaviour of methods. Personally I prefer two different methods for two different things. But if a boolean flag is an acceptable compromise then I'll take it. > Performance regression due to cyclic hashCode guard > --------------------------------------------------- > > Key: LANG-1229 > URL: https://issues.apache.org/jira/browse/LANG-1229 > Project: Commons Lang > Issue Type: Bug > Components: lang.builder.* > Affects Versions: 3.5 > Reporter: Philippe Marschall > > We observed a severe performance regression in HashCodeBuilder in 3.5 trunk compared to 3.4 release. We get about 20% of the throughput in 3.5 trunk for common cases compared to 3.4 release. Previously there was no noticeable overhead of using HashCodeBuilder. Investigating we found the performance degradation was caused by the fix for LANG-456. It causes the method to be too large to be inlined and escape analysis to fail (see LANG-1218 for a related discussion). > We currently do not see a way to keep the 3.4 performance and support cyclic graphs. The append methods have not supported cycles for so long we feel it's de facto part of the contract by now. Since neither the JDK nor the Guava hashCode helper methods support cyclic graphs we don't believe this is an unreasonable assumption. In addition EqualsBuilder#append(Object,Object) doesn't support cycles. > If supporting cycles is a requirement we propose the introduction of new #appendRecursive (or named differently) methods to both HashCodeBuilder and EqualsBuilder that add cycle guards. If that is an acceptable compromise we would be willing to provide patches. -- This message was sent by Atlassian JIRA (v6.3.4#6332)