Tuesday, August 11, 2015

Which is faster a calc or an allocation? Part 1

There are two or more ways to do of things in Essbase. Calculations within an ASO cube are no exception. You can write an allocation or a procedural calc. I tend to prefer to write allocations because then I'm not forced to maintain a second file which is necessary when writing procedural calcs. So I thought I'd test out which was faster doing essentially the same operation. In this case I'm copying a scenario in a very large ASO cube. The cube has approximately 25GB of input data.

First the allocation:
execute allocation process on database TEST.TEST with
pov "CrossJoin({[Version1]},
CrossJoin({Descendants([Time],Levels([FY],0))},
CrossJoin({Descendants([ALL_ACCOUNTS],Levels([ACCOUNT],0))},
CrossJoin({Descendants([ALL_PRODUCTS],Levels([PRODUCT],0))},
CrossJoin({Descendants([ALL_STORES],Levels([STORE],0))},
{Descendants([ALL_DIVISIONS],Levels([DIVISION],0))})))))"
amount "([2014 ACTUAL])"
target ""      
range "{[TEMP]}"
spread;

OK/INFO - 1300006 - Essbase generated [3.07368e+08] cells.
OK/INFO - 1013374 - The elapsed time of the allocation is [4230.69] seconds.





Now the calc:
execute calculation on database TEST.TEST with
local script_file "test.csc"
pov "CrossJoin({[Version1]},
CrossJoin({Descendants([Time],Levels([FY],0))},
CrossJoin({Descendants([ALL_ACCOUNTS],Levels([ACCOUNT],0))},
CrossJoin({Descendants([ALL_PRODUCTS],Levels([PRODUCT],0))},
CrossJoin({Descendants([ALL_STORES],Levels([STORE],0))},
{Descendants([ALL_DIVISIONS],Levels([DIVISION],0))})))))"
sourceregion "{[2014 ACTUAL]}";

OK/INFO - 1300006 - Essbase generated [3.07368e+08] cells.
OK/INFO - 1013372 - The elapsed time of the custom calculation is [4477.39] seconds.

Contents of test.csc:
([TEMP]) := ([2014 ACTUAL]);


So the allocation ran in 70:30. The calc ran in 74:37. The allocation was almost 6% faster. Not an enormous difference with this particular operation but it's another reason to use allocations over calcs when possible.

No comments: