Giter Site home page Giter Site logo

Fix at times broken reactiveness about nostroid HOT 6 OPEN

giszmo avatar giszmo commented on July 19, 2024 1
Fix at times broken reactiveness

from nostroid.

Comments (6)

Giszmo avatar Giszmo commented on July 19, 2024

As the issue is very erratic - it might be one write that takes long and all before and after are smooth - I don't see how to "throttle when it gets too slow". For less powerful machines, 500 puts at a time might take too long, so maybe there is room for some mechanism that keeps the median bulkPut below 100ms but that's another issue.

from nostroid.

Giszmo avatar Giszmo commented on July 19, 2024

Apparently events get downloaded repeatedly whenever the SharedWorker starts. Observed from the relay side "53000 events were sent in 153ms", which definitely is too big a burst for the client.

from nostroid.

snuffyDev avatar snuffyDev commented on July 19, 2024

While investigating this I noticed a lot of the memory allocations come from Dexie. I’m also investigating what improvements, if any could be had, from using a RWLock to have a way to control the reads and writes

from nostroid.

snuffyDev avatar snuffyDev commented on July 19, 2024

After taking some time to ‘reset’ my brain, I’ve managed to achieve (in my opinion, after testing it for a good amount of time) a more consistent experience.

Demo: https://nostroid-test.vercel.app/

Currently preparing to commit my changes to my fork, and create a PR once I clean up a couple things and pull in the latest commits.

from nostroid.

snuffyDev avatar snuffyDev commented on July 19, 2024

364B2A0F-A325-477A-AC60-E93175498EBC

The heap allocations still isn’t great, which I have a few ideas on how to minimize them, but the bulk of them come from Dexie and the crypto libs it appears.

F8B9B959-4E93-4D46-B553-03BA0F7EE4C6

For reference, here’s the bar graph on this repos deployed build.

Both profiles were taken starting from the very start of the page render, to ~1-1.5 mins after it stops getting new events (around 15k)

from nostroid.

Giszmo avatar Giszmo commented on July 19, 2024

Your deployment indeed feels smoother.

The nostr library I think is part of the problem as switching it for another one had a dramatic impact on performance but that other one wasn't ready for all the features yet. It might be worth giving it another try.

from nostroid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.