Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-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 E300B17BD6 for ; Sun, 8 Feb 2015 10:38:34 +0000 (UTC) Received: (qmail 31607 invoked by uid 500); 8 Feb 2015 10:38:34 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 31471 invoked by uid 500); 8 Feb 2015 10:38:34 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 88045 invoked by uid 99); 6 Feb 2015 22:38:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Feb 2015 22:38:33 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of phil.steitz@gmail.com designates 209.85.220.52 as permitted sender) Received: from [209.85.220.52] (HELO mail-pa0-f52.google.com) (209.85.220.52) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Feb 2015 22:38:27 +0000 Received: by mail-pa0-f52.google.com with SMTP id kq14so12528155pab.11 for ; Fri, 06 Feb 2015 14:36:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=UZyINaqSGihea7Cjrml1iIiFmiGX93E66HUzRbRf65Q=; b=mCWoy/trdy55sYvqgKZW3o2RqrYpMMEyWaGnbtidDtVW5Csj8Ndm9cSJYkM3L37k0V J07xeXyRvJiwwnlGs/veM7AqZgGHD/5GZuTo2vxWSPRrI6Aws8gtkwxKmgJLE9J7D+IR kLww3G7YWnD5SzilscdLGTPO3oum57kJMVk2nBnHuC9vTayNo81asWuwyi1fzYBd6AC9 EMgcztGUQDC47vt6vCgNDsEjr50ZevYhG6jLGirYaHDdf8GsTsr8XOmaVOoueagpEn+q 5mh2Yprq6lslffQQw+Ak4g51fEy7p3TOzepsTrPshIs8SuK2bKvxbphv5xrH/+OpkMGL jl7Q== X-Received: by 10.70.128.231 with SMTP id nr7mr9363039pdb.116.1423262196870; Fri, 06 Feb 2015 14:36:36 -0800 (PST) Received: from psteitz-mbp.local ([208.77.60.192]) by mx.google.com with ESMTPSA id uc2sm9034181pbc.56.2015.02.06.14.36.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Feb 2015 14:36:35 -0800 (PST) Message-ID: <54D541F1.3040601@gmail.com> Date: Fri, 06 Feb 2015 15:36:33 -0700 From: Phil Steitz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Commons Developers List Subject: Re: [Pool2] Alternative identity hashmap pool implementations References: <54D51CCE.40306@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 2/6/15 1:28 PM, sebb wrote: > On 6 February 2015 at 19:58, Phil Steitz wrote: >> On 2/6/15 11:56 AM, sebb wrote: >>> There seem to be a few use-cases for pools that always treat different >>> instances as different entries, rather than using the current equals() >>> check. >> Yes >>> Would it make sense to implement alternative versions that accept an >>> object and wrap it in a class that implements equals() using == and >>> System.identityHashcode? >> Yes, we should definitely support this use case. >>> The IdentityWrapper class was suggested here: >>> >>> https://issues.apache.org/jira/browse/POOL-283?focusedCommentId=14307637&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14307637 >>> >>> I think it could be done by subclassing the existing implementations >>> to provide the wrapping/unwrapping support. >>> >>> There would be an overhead because the wrappers would need to be >>> created every time an object was passed in. The wrappers are very >>> small. >> Once I get the DBCP release I am working on out, I plan to explore >> all three alternatives in my comment on POOL-284. The performance >> regression testing tool that Thomas found and referenced on that >> ticket looks very interesting and could help assessing the cost of >> wrapping / unwrapping or changing the current impl to use >> sync-protected IdentityHashMap. > Changing to IdentityHashMap implies dropping support for > equals()-equivalent pool entries. > Are there no use-cases for such behaviour? Good point. We would probably want to make this configurable. Phil > >> If we can get a solution that "just >> works" at demonstrably very low cost, I will advocate for that. If >> not, then probably what you are describing above, made available >> like other custom pools via PoolUtils, makes sense. >> >> Phil >>> S. >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>> For additional commands, e-mail: dev-help@commons.apache.org >>> >>> . >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >> For additional commands, e-mail: dev-help@commons.apache.org >> > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org