Ive built a PubSub simulator (+benchmark)

Hi, I wrote a simple pubsub simulator with join/leave topic, add/remove peer and peers friending each other and joining each others topics. The discovery is set to MockDiscovery (theres code for DHT and mDNS too, but had a huge lag with DHT). All the params can be adjusted (amount of peers, topic, etc), so maybe someone will find it useful.

The motivation behind it was to stress test a state machine library I’ve been working on, for which Ive ported ~half of pubsub to asyncmachine-go, including MockDiscovery. Theoretically any implementation could be used, but the state-based one exports bulks of data, which can be consumed by grafana/jaeger.

Theres also a benchmark with charts showing the overhead for TestSimpleDiscovery. This one is very open to work with other implementations and/or running any other test from the suite.

1 Like

This is freaking cool! Thanks for doing that work. I’ll let the go-libp2p community know. You could also make a post like this in the go-libp2p technical discussion forum on Github. You could also come to the next go-libp2p Maintainers Meeting and demo it for us.

Cheers! :beers:

Thanks for the feedback! I will be more then happy to drop a short demo on the jul-18 meeting, and Ive already signed up with my github handle.

I also wasn’t aware that discussions have moved over to github. Will post future updates over there instead.