Optimized some slow parts of the engine.
Last low hanging fruit: parsing is slow, cache parsed calculations
This commit is contained in:
@@ -7,9 +7,12 @@ import getAggregatorResult from './getAggregatorResult.js';
|
||||
export default function computeImplicitVariable(node){
|
||||
const prop = {};
|
||||
const result = getAggregatorResult(node);
|
||||
prop.total = result;
|
||||
prop.value = result;
|
||||
prop.proficiency = node.data.proficiency;
|
||||
if (result !== undefined){
|
||||
prop.value = result;
|
||||
}
|
||||
if (node.data.proficiency !== undefined){
|
||||
prop.proficiency = node.data.proficiency;
|
||||
}
|
||||
|
||||
// denormalise class level aggregator
|
||||
let classLevelAgg = node.data.classLevelAggregator;
|
||||
|
||||
@@ -35,6 +35,7 @@ function evaluateCalculation(calculation, scope){
|
||||
// remove the working fields
|
||||
delete calculation._parseLevel;
|
||||
delete calculation._parsedCalculation;
|
||||
delete calculation._localScope;
|
||||
}
|
||||
|
||||
function embedInlineCalculations(inlineCalcObj){
|
||||
|
||||
Reference in New Issue
Block a user