You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Phil Steitz (JIRA)" <ji...@apache.org> on 2007/09/07 21:23:30 UTC

[jira] Closed: (DBCP-239) Performance bottleneck on Abandoned Object Pool

     [ https://issues.apache.org/jira/browse/DBCP-239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz closed DBCP-239.
----------------------------

    Resolution: Won't Fix

Thanks for looking into the code and please do not take this the wrong way, but I am closing this as WONTFIX because it is not obvious to me that LinkedList will give better perfornance for the most common configurations of dbcp.  A quick microbenchmark using the performance package in the commons sandbox with a pool size of 25 actually showed worse performance with LinkedList.  This is likely because adds are to the end of the list and the list is short.  Java LinkedList is not always faster even when only iteration and add/remove ops are used.  See, e.g.,
http://www.javaspecialists.co.za/archive/Issue111.html
http://java.sun.com/docs/books/tutorial/collections/implementations/list.html
http://java.sun.com/developer/JDCTechTips/2002/tt0910.html
I have not done extensive microbenchmarks - pls feel free to reopen if you can demonstrate that performance will be improved using LinkedList over a range of configurations common for users of dbcp.

> Performance bottleneck on Abandoned Object Pool
> -----------------------------------------------
>
>                 Key: DBCP-239
>                 URL: https://issues.apache.org/jira/browse/DBCP-239
>             Project: Commons Dbcp
>          Issue Type: Improvement
>    Affects Versions: 1.2.2, 1.3
>            Reporter: Takayuki Kaneko
>         Attachments: patch.txt
>
>
> AbandonedObjectPool uses ArrayList as trace variable to manage connections.
> I found a bottleneck on it.
> returnObject(Object) has a synchronized block and it will be a bottleneck if it manages a lot of connections.
> ArrayList#remove(Object) has to do arraycopy each time. It is tuned by native code, but it is still slower than LinkedList#remove(Object).
> IMO, the list doesn't access by index, so LinkedList is better than ArrayList.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.