commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <>
Subject [jira] Closed: (DBCP-239) Performance bottleneck on Abandoned Object Pool
Date Fri, 07 Sep 2007 19:23:30 GMT


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.,
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:
>             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.

View raw message