Optimized some slow parts of the engine.

Last low hanging fruit: parsing is slow, cache parsed calculations
This commit is contained in:
Stefan Zermatten
2021-09-29 15:54:14 +02:00
parent cb10b53a10
commit cb1fd38df3
21 changed files with 151 additions and 96 deletions

View File

@@ -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;

View File

@@ -35,6 +35,7 @@ function evaluateCalculation(calculation, scope){
// remove the working fields
delete calculation._parseLevel;
delete calculation._parsedCalculation;
delete calculation._localScope;
}
function embedInlineCalculations(inlineCalcObj){