Like all software tools, OrgVue is built to perform quickly, and each release includes features to decrease calculation time, make lookups more efficient, or increase the number of records that can be handled. However, users also have a lot of influence on how well their dataset or tenant is performing. If you experience slow evaluation times and Flash crashing, try these 5 pointers:
1. Write expressions in the property value box (not individual cells)
Expressions are the biggest contributor to a slow dataset, and you can mitigate this by optimising where you write expressions, how you write expressions, and how you configure them. If you want to create a calculated property, writing the expression in the property value box (in the Edit Property dialog) is by far the best way of doing it. Writing directly into cells means that the expression has to be compiled for every node, rather than just once, and can cause larger datasets to run very slowly.
2. Write expressions as efficiently as possible
OrgVue expressions are written using Gizmo, a JavaScript-like language. Whilst you can’t be expected to write expressions like a developer, there are some simple rules you can follow to make your expressions quicker to run and proof check:
- Don’t repeat yourself
- Make expressions easy to follow
- Try to keep up-to-date on the newest syntax
- Bear in mind what the purpose of the expression is.
For more explanation of these, see part 2 of this blog series.
3. Configure expressions so they only re-calculate as needed
As OrgVue’s default, every time the data are loaded it scans all the cells in a property until it encounters an expression. This increases the time it takes OrgVue to load or re-process a dataset. However, you can use the 5 evaluation options in the Edit Property dialog to dramatically increase performance by stopping expressions needlessly recalculating.
Avoid using the ‘auto’ setting which detects expressions (at a high performance cost) and evaluates them whenever data changes. Choose the ‘none’ setting when no cell for this property should be evaluated as an expression. Choose the ‘node’ setting when the expression only needs to be re-evaluated when the node is changed. Choose the ‘hierarchy’ setting when the expression is dependent upon the node’s descendants e.g. as node.rollup(“salary”,”sum”).
If you only need the expression to be calculated once (or rarely) and remain static most of the time, add a “!!” to the end of the expression. The results will now be hard-written into the cells (like if you had chosen “Initial” value mode). To trigger a recalculation, remove all the values from your property by blank splashing (!!*).
4. Use ‘settemporary’ (and ‘script’ mode) to evaluate all your properties in one
Rather than typing individual expressions directly into the Default Value box for properties to be calculated, OrgVue enables multiple properties to be set via a single expression held either in a specified property or executed via a script. This means only one expression is evaluated for each node but a range of calculated values are returned for multiple properties; this increases performance in datasets where multiple properties contain calculated values and allows the reuse of traversals (expressions calculating up and down the tree).
To use settemporary:
- Create a property called “Expressions” (or indeed, any other convenient name),
- Set the default value of this property as “node.settemporary({ a:x, b:y, …, c:z})” where:
a, b, c = the names of properties that are going to be populated with calculated values, and
x, y, z = the expressions to be evaluated
NB. The names that need to be listed are the property key values, exactly as they appear in the Edit Property dialogue. You cannot include any dependencies in the settemporary expression, so you couldn’t include bonus (10% of salary) and total cost (salary+bonus).
- Set the evaluation type of all the properties evaluated in this way to “script”.
5. Keep your tenant tidy
How quickly your tenant opens and performs depends on 3 main factors:
- The number of datasets (inc. links and reports) it contains
- The size of those datasets
- The amount and complexity of calculations across the tenant
To make your tenant run as fast as possible, you should consider:
- Deleting old (versions of) datasets
- Only creating links between datasets that are being consistently used
- Combining lookup datasets so they do not overlap (ie. no 2 lookups share the same unique id)
- Storing any scripts (e.g. for custom dashboards, colour palettes, or containing lots of expressions) centrally. For more information on how to do this, get in touch with your superuser or an OrgVue consultant.
Hopefully these methods will help you to use OrgVue as efficiently as possible. If you ever have questions or ideas, the OrgVue Portal is a great way for OrgVue users to find technical answers, share best practice and suggest improvements to the product. I’ve also written a series of blog posts about problem solving in OrgVue: Abstracting the problem, Six simple checks and Not seeing what you expected?
Otherwise you can get in touch with me: Ben.Marshall@orgvue.com