Applied Dimensionality

Another PA Performance tip "Don't read from and write to the same cube in TIs" or "The cunning of CellIncrement"

Posted at — Jul 31, 2020
Another PA Performance tip "Don't read from and write to the same cube in TIs" or "The cunning of CellIncrement"

Some of the largest performance gains I saw on a recent project came from ‘breaking up the circles’ in TI processes, so I thought that I’d do quick write-up on it. Nothing new, just the good old ‘don’t read and write at the same time’ adage. We humans like everything circular (our lizard brain is wired to recognise other human’s eyeys and be happy about), whereas TM1 really doesn’t like it all, anything remotely circular (rule dependencies, TIs) causes cache invalidation and massive performance degradation.

The usual example is quite straight-forward:

You have a complicated cube with a number of rules and largish feeders (or even feeder chains to other cubes) and you write an innocent looking TI that would update this cube from itself or from anywhere else and use CellIncrementN instead of CellPutN and suddenly everything grounds to halt. My usual rule of thumb is that I want to see around 30k cells processed per second, whereas such TIs would be notoriosly slower, processing 50-100s of cells per second.

There’s a number of backend technical reasons: cache invalidation, need to reevaluate feeders and re-fire dependencies and other chickanery, but the end result is that processes run slow as molasses.

My usual solutions are:

comments powered by Disqus