On my JavaScript calculator ( https://github.com/zelite/JavaScript-Calculator ), i noticed that when the page is loaded and I try to make the first calculation, e.g: 1 + 2, there is a small freeze in between the + and the 2. The number 2 takes a bit longer to show up. This only happens on the first calculation. If I press AC the calculator is reset to the starting state but the small freeze does not happen again. If I reload the page then the freeze will happen once more at the first calculation.
Do you also see the same issue on your side? Any suggestion on how i can figure out what’s going on? Or maybe someone has seen this behavior before and knows the likely cause for it?
I am using math.js to deal with the calculation. And it seems that only loads the library on the first calculation (some sort of lazy loading must be going on).
So I just make a calculation in the background before the calculator is initialized and from there everything seems to go smoothly.