This post explains a common misconception about FIXPARALLEL
More threads don’t always mean better performance. Running calculations in parallel comes with some overhead.
If you are only splitting a small number of members across threads, that overhead can outweigh the performance. FIXPARALLEL is most effective when there is enough work to distribute across multiple threads. That said, the best way to know is to test it with your own data and see how it performs.
My example
I am using FIXPARALLEL to split up the entity members in a currency conversion script.
With a regular FIX:
SET UPDATECALC OFF;FIX("Budget","Working",&BudgetYr,@Relative("YearTotal" 0),) FIX(@Relative("Net Income",0),@Relative("Total Product",0),@Relative("Total Entity",0)) "USD" = "Local" * "FX_Avg_Rate"->"Local"->"No Entity"->"No Product"; ENDFIXENDFIX
And the same calc with FIXPARALLEL, split by Entity:
FIXPARALLEL (5, @Relative("Total Entity", 0)) FIX ("Budget", "Working", &BudgetYr, @Relative("YearTotal", 0), @Relative("Net Income", 0), @Relative("Total Product", 0)) "USD" = "Local" * "FX_Avg_Rate"->"Local"->"No Entity"->"No Product"; ENDFIXENDFIXPARALLEL
The only change is moving Entity out of the FIX and into the FIXPARALLEL member list.
I ran both on the same data, with different numbers of entities:
| Entities | FIX | FIXPARALLEL |
|---|---|---|
| 1 | 0.14 sec | 0.15 sec |
| 5 | 2.7 sec | 2.4 sec |
| 25 | 11.7 sec | 3.7 sec |
| 100 | 127 sec | 40 sec |
With one entity, FIXPARALLEL was a little slower. There is only one task, so there’s nothing to split. With five entities, it was only about 10% faster. From 25 entities on, it was more than 3 times faster.
The numbers will be different in your application, but the pattern is the point. Oracle also recommends not using parallel calculation for small scripts. For example, ones that run in less than 20 seconds, and thinking about other users running rules at the same time, because they all share the same threads.
A few things to keep in mind:
- Only use it when each member can be calculated on its own. If entity A reads a value that entity B writes in the same pass like an allocation. Then, don’t split by Entity.
- Pick a dimension with enough members to keep the threads busy. With fewer members than threads, some threads have nothing to do
- FIXPARALLEL supports up to 8 threads
- Test it with your own data and check the result before and after
Hopefully this is helpful to you.
Leave a Reply