From 69d33391e35c7016262e41ed4d3c2a3967f5f0b7 Mon Sep 17 00:00:00 2001 From: mama Date: Tue, 12 Dec 2017 20:37:42 +0100 Subject: [PATCH] WIP investigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pourquoi l'étape nextWithoutDefaults prend autant de temps ? --- source/engine/mecanisms.js | 2 +- source/reducers.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/engine/mecanisms.js b/source/engine/mecanisms.js index 4feac591a..6becac48c 100644 --- a/source/engine/mecanisms.js +++ b/source/engine/mecanisms.js @@ -458,7 +458,7 @@ export let mecanismInversion = dottedName => (recurse, k, v) => { let evaluatedNode = rewriteNode(node, nodeValue, null, collectMissing) // rewrite the simulation cache with the definitive inversion values - + R.toPairs(inversion.inversionCache).map(([k,v])=>cache[k] = v) return evaluatedNode } diff --git a/source/reducers.js b/source/reducers.js index 504eaba0c..8d25baf33 100644 --- a/source/reducers.js +++ b/source/reducers.js @@ -64,8 +64,11 @@ export let reduceSteps = (tracker, flatRules, answerSource) => ( let parsedRules = R.path(['analysis', 'parsedRules'], state), + date = Date.now(), analysis = analyseMany(state.parsedRules, targetNames)(situationWithDefaults(state)), + yaya = console.log('Date.now(', Date.now() - date), nextWithDefaults = getNextSteps(situationWithDefaults(state), analysis), + yaaya = console.log('Date.now2(', Date.now() - date), assumptionsMade = !R.isEmpty(rulesDefaults), done = nextWithDefaults.length == 0 @@ -83,6 +86,7 @@ export let reduceSteps = (tracker, flatRules, answerSource) => ( nextWithoutDefaults(state, analysis, targetNames, intermediateSituation) : {currentQuestion: head(nextWithDefaults), nextSteps: nextWithDefaults, }) } + console.log('Date.now3(', Date.now() - date) if (action.type == START_CONVERSATION) { return {