I can now reproduce the blocking by just opening the game in 30 tabs. Then it slows to a crawl and in some tabs freezes mid sentence for up to a few dozen seconds.
Aside: the server is the result of asking “can I just wire stdin and stdout to a websocket to bring these terminal games into the browser”. ☺ I now also wire stderr to the websocket (that’s how the commands to show images and play music or sound effects are realized).
So this is a hack to bring interactive fiction games that usually run on the terminal (and can be tested there efficiently) to the browser. As one of the next steps I want to add a dedicated GUI with chickadee so the download-version can provide a look that’s closer to interactive fiction games built with Ren’Py. I’ll see how far I can push it. Though I’m moving slowly: too much other stuff at the same time. And there’s optimization left to do: fibers can do a million userspace threads at the same time, but a thousand microsleeps per second are currently costly.