Replying to Avatar gsovereignty

I'm totally new to programming for the browser but I'm starting to appreciate the challenge (actually quite a lot more difficult than systems level programming in many ways).

The main gotchya I'm hitting is that the browser is built around a single threaded event loop. It alternates between doing computation, and updating the page. When a page feels all clunky and slow it's (probably) because the computation part is taking a long time and blocking all the other updates waiting to be rendered on the page.

But it turns out there are these things called web workers, which allow computation to be done "on the side" and not block anything.

If I can manage to get all the relay/subscription and event computation done within web workers, this should make the user experience much smoother and generally improve the performance of the nostrocket client.

I'm experimenting here if anyone wants to follow the progress: https://github.com/nostrocket/buttr

Avatar
florian 1y ago

💯 I have a similar issue with slidestr.net which needs to extract all image urls from notes - have tried to avoid web workers for now, but it’s the best solution I suppose.

Reply to this note

Please Login to reply.

Discussion

No replies yet.