flagxor / ueforth

Apache License 2.0
95 stars 26 forks source link

100% CPU load #49

Closed farvardin closed 7 months ago

farvardin commented 1 year ago

I've seen even when idle, the ueforth REPL is running at 100% CPU. Maybe it could be possible to detect if there is no activity and then be lighter on the CPU?

FoundOne commented 1 year ago

I can confirm that the latest git version build just runs my laptop's CPU at 100% and does nothing. My specs are: Void Linux x86_64-musl, NodeJS v18.16.0, GCC 12.2.0 Remark: I try to build the posix build. I have to link /usr/bin/node to /usr/bin/nodejs in order the build to work and the test suit nearly freezes my computer, because of the 100% CPU overload.

flagxor commented 7 months ago

Oh, very good point. In making KEY? I've ended up making it spin loop when waiting for a key. Working on a fix...

flagxor commented 7 months ago

Fix in eaa8a3c4c3ec00995ffc42873992b3dd89101d4f

farvardin commented 7 months ago

@flagxor thanks for this fix! It works fine for the desktop version. Now I've seen the pause? word has been added to the web version as well, but it's not activated, so there is also a high CPU load on the web (it's above 90% for the tab with the ueforth website)

Maybe it's also the same on the esp32 version?