fabiooshiro / xlsx-calc

javascript nodejs excel formula parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

performance refinement

YJMLWZ opened this issue · comments

some formulars calculated twice, can be refined to improve performance.

e.g. formular[1] refer to formular[2], then in below loop we can skip re-calculate formular[2]

exec_formula(formulas[i]);

I think that we handle this situation. Take a look if there is some flag to tell that the cell is calculating, calculated, etc.

yes, in RefValue.js and Range.js there are some checks to avoid re-calculate, but still there are re-calculate case in the loop pointed by me.
I mean if formualr[1] refers to a cell which also contains a formular, let's say it is formular[5], then formular[5] actually already calculated during calculation of formular[1].
so we can skip when the loop reach formular[5].

in my case , around 33% formulars are re-calculated, and a refinement can improve a lot.

See the last commit please: 50a5c79

By the way, could you do some benchmark tests?