Quote:
Originally Posted by capink
This does not use assignments and should have better performance. I wonder whether putting this in a custom column instead might be better performance wise?
|
No. Color and icon rules cache the compiled template, as does a composite column, so there is no difference in execution time. Calibre also caches the results of rule evaluation, so a rule is reevaluated only if calibre thinks the data might have changed. This is roughly the same as the process used to cache composite column evaluation results.
Of note:
- calibre generates GPM templates for all color/icon rules. There is no additional overhead in using advanced rules.
- If your rules use stored templates then the compiled stored template is also included in the cache.
- The new GPM template parser 'compiles' the template into an interpretable tree. The old parser 'compiled' the template into a stream of lexical tokens. The new scheme will be faster than the old one, especially for complex templates.
- The "test" function used to evaluate both the "true" and the "false" branches then pick the right one. The function is now inlined as "if-then-else" where the unused branch is not evaluated.