classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: Removed ObjectPool


From: Roman Kennke
Subject: [cp-patches] FYI: Removed ObjectPool
Date: Fri, 01 Jul 2005 19:04:56 +0200

Hi,

I did some simple benchmarks with the proposed ObjectPool thing. These
show that there is really not much gain from it, at least in a real
world environment (where the number of requested objects != number of
returned objects). It can be somewhat expected that the speed
performance actually decreases, but it is doing quite dramatically
(factor of > 5). What I did not expect, that also memory usage is not
significantly improved, actually getting worse (on JamVM), I think this
is because of the not-ideal situation that I simulated, where not every
object is beeing put back into the pool. Anyway, I consider this an
interesting lesson (at least it was for me), and remove this class again
from the tree, sorry for the noise.

This does not mean that the object usage should not be improved in Swing
and some Rectangles and Dimension be cached. There are several cases
where a method like getBounds() (which allocates a new Rectangle) has a
counterpart getBounds(Rectangle r) (which does not allocate a new
Rectangle but uses r as return value). Also, we developers should be
sensible with object allocations (or methods that possible allocate
objects like getBounds()). In my benchmarks I got >30000 Rectangles
allocated within some seconds of the ODB starting up...

2005-07-01  Roman Kennke  <address@hidden>

        * gnu/classpath/ObjectPool.java:
        Removed this class. Some simple benchmarks show that it
        brings not much gain and actually decreases performance
        speed-wise.

no patch attached, source file has been removed.

/Roman






reply via email to

[Prev in Thread] Current Thread [Next in Thread]