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.

3 Likes

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:
Dave

1 Like

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.

1 Like

@pancsta did you happen to make it to a go-libp2p meeting? I don’t see you in the notes at all. The next go-libp2p meeting is tomorrow: go-libp2p Open Maintainers Call · Luma I would love to see a demo of what you’ve built.

@dhuseby I did actually, but it seemed to be the EU-time one with a very few people attending. I’ve recorded it quickly and cross-posted to GH - Show: PubSub simulator & benchmark, with demos (some interactive) · libp2p/go-libp2p · Discussion #2891 · GitHub.

Unfortunately, I can’t make it to today’s meeting, but have already started to work on another thing, this one should be actually useful for other ppl, as it uses the stock go-libp2p-pubsub. I could possibly demo both in the future…

1 Like