Naruyoko / OmegaNum.js

A huge number library holding up to 10{1000}9e15. A basement for planned {10,x,1,2}.
https://naruyoko.github.io/OmegaNum.js/index.html
MIT License
32 stars 15 forks source link

Performance issues with the constructor, fromString, and standardize #36

Open Naruyoko opened 2 years ago

Naruyoko commented 2 years ago

Run the following with profiler:

for(var i=0;i<10000;i++)OmegaNum.hyper(Math.random()*10+3|0)(Math.random()*100+3,Math.random()*100+3);

On my configuration, it ran for 15975ms, taking 3529.7ms in fromString, 3153.3ms in OmegaNum, and 3000.6ms in standardize (self time). The same functions appear by profiling True Infinity Beta. This is quite bad. Of these 3, I think fromString and standardize can be rewritten to perform much better. Maybe it is time to work on it.