Below are some performance comparisons of the new pool service. The tests
have been executed for 100 000 empty objects in a 300 MHz P2, so the
absolute values are not as interesting as the the relative comparisons.
Direct instantiation doesn't include GC, PoolService include both put and
get operations.
Default constructor (msecs)
------------------------------------------------------------------
Direct instantiation Class.forName() FactoryService PoolService
50 4 700 3 800 4 000
Constructor with 3 String params (msecs)
------------------------------------------------------------------
Direct instantiation Class.forName() FactoryService PoolService
50 - 18 800 22 100
As you can see, pooling doesn't improve short-term performance, it's really
meant for balancing memory consumption. However, for more complicated
objects that can possibly maintain their initialization state during
pooling, the difference in performance should be smaller or even opposite.
The time is consumed to synchronization and, when parameters are involved,
to reflection.
To make the pool service perform slightly better, I've reduced
synchronization with cloning and reflection with caching in the new version.
I added also methods to get/set class specific pool capacity and pool size
to make it more flexible. The best performance improvement was achieved in
pooling of parameterized instances.
Default constructor (msecs)
------------------------------------------------------------------
Direct instantiation Class.forName() FactoryService PoolService
50 4700 3 800 2 600
Constructor with 3 String params (msecs)
------------------------------------------------------------------
Direct instantiation Class.forName() FactoryService PoolService
50 - 18 800 3 400
For 100 000 RunData objects the results are the following with the new
version.
Without initialization (msecs)
---------------------------------
Direct instantiation PoolService
500 2 800
With initialization (msecs)
---------------------------------
Direct instantiation PoolService
30 000 32 000
-- Ilkka
--
Nokia Networks
http://www.nokia.com/networks
mail: [EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]