Holster Performance Improvements

The great thing about writing a complicated application that relies on Holster being responsive to requests, is that you quickly find where the bottlenecks are. Claude also knows that the two projects are heavily related and is happy to switch between code bases when it find a problem in either. So when I Haza Website started slowing down with lots of pages in a project, it will go looking at the Holster code pretty quickly when looking for a reason.

The Holster 2.3.5 release is the performance improvements it found, with an impressive result that Holster now runs it's test suite in 3.5 seconds, down from nearly 6 seconds (in parallel). This is mostly thanks to removing a retry check, which made sure references to nodes existed before they're used. This was definitely a good check to have, but a concurrency issue fixed in an earlier release inadvertently removed the need for it. It did this by serializing rel creation for the same soul and property.

The retry meant many requests were waiting at least the minimum 50 milliseconds just to be sure it existed, but it was no longer necessary and there are specific tests that show that. I Haza Website has it's own tests and these went from 150 seconds down to under 60 seconds to run the full test suite.

Some other improvements went into this release, such as only responding to a client making a request rather than broadcasting the response to all clients. This reduces wire chatter while allowing actual changes to propagate as expected. Clients already ignore data they haven't asked for so the extra broadcasts weren't being listened for anyway.

Another improvement for browser requests is relaxing the message queue rates when making requests. It was initially designed to prevent overloading both browser CPU and relays that clients request data from, but it can do this while also being responsive to application requests which tend to occur in bursts. Requests can now go out in batches of up to 100, instead of waiting 50 millisecond between each request. Browsers now also check if they're connected to any peers, which means there's no reason to wait before resolving the request when offline.