[Mondrian] Performance: CellInfoPool

Anton Nikitin cybernelly at gmail.com
Thu Aug 16 10:12:55 EDT 2007


I just run very simple code snippet:


==== CODE START ===
    public static void main(String[] args) {
        try {
            CellInfoPool pool = new CellInfoPool(2);
            CellInfoMap map = new CellInfoMap(
                    CellKey.Generator.newCellKey(2));

            // Testing CellInfoMap
            long millis = System.currentTimeMillis();
            for (int i = 0; i < 500; i++) {
                for (int j = 0; j < 500; j++) {
                    map.create(new int[]{i, j});
                }
            }
            System.out.println("CellInfoMap: " +
                    (System.currentTimeMillis() - millis) + " ms");

            // Testing CellInfoPool
            millis = System.currentTimeMillis();
            for (int i = 0; i < 500; i++) {
                for (int j = 0; j < 500; j++) {
                    pool.create(new int[]{i, j});
                }
            }
            System.out.println("CellInfoPool: " +
                    (System.currentTimeMillis() - millis) + " ms");

        } catch (Throwable x) {
            x.printStackTrace();
        }
    }
==== CODE END ===

My result:

CellInfoMap: 63 ms
CellInfoPool: 22202 ms

I also ran some examples before but couldn't get such results.
IMHO the performance really depends on keys...

Anton

-----Original Message-----
From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org] On
Behalf Of Julian Hyde
Sent: Tuesday, August 14, 2007 7:40 AM
To: 'Mondrian developer mailing list'
Subject: RE: [Mondrian] Performance: CellInfoPool

 
> Peter Tran wrote:
>
> ObjectPool performs a lot better than HashSet for the String test and
> comparable for the Integer test.
> 
> Am I reading this wrong?

You are correct, Peter. My tests show there is no performance bug with
ObjectPool.

ObjectPool is also superior for this purpose because it uses significantly
less memory.

There still might be a performance bug with CellInfoPool - I didn't test
that.

Julian

_______________________________________________
Mondrian mailing list
Mondrian at pentaho.org
http://lists.pentaho.org/mailman/listinfo/mondrian




More information about the Mondrian mailing list