Closed oliveratgithub closed 2 years ago
P.s.: I switched to TypewriterJS as I'm not seeing the performance issues there.
@oliveratgithub Sorry you were having trouble. I was not able to recreate the issue in your first example. If you are able to provide a link to a working reproduction I could take a look.
In your second example, I would expect to see issues since you are calling typical in an infinite loop.
@camwiegert thanks for your feedback. You're right my Example 2 was not ideal - not a JS novice 🙈 When I switched to TypewriterJS I also solved the section loop differently.
However, regarding Example 1 it might be worth mentioning that I tested/observed the CPU usage with Safari 12 on macOS 12 Monterey, on an intel MacBook Air 2018.
Hi there, I have 3 Typical texts running on my page. But I noticed some major performance usage – like even Fans start spinning when my page is open, plus Activity Monitor shows the website's progress taking like 30%-60% of all CPU, WHILE Typical is "typing" the texts. Very uncommon for a quite simple page…
Has anyone observed something similiar?
I have two example cases that lead to my finding. When disabling any of them, the page performance & CPU usage drops to an expected (non relevant) level.
Example 1
"Simple" use as according to the docu / examples (unless I missed something)
While running, page performance is decreased / CPU spikes to 60%+.
Example 2
Instead of just looping 1 and the same text, I am looping a group of 3 different typing texts - one after each other, after the last one, the 1st starts again.
For this I use a while() { }-loop:
Page performance here is constantly 30%+ and spikes to 60%+ while Typical is "typing".