Daniel Lemire's blog

, 2 min read

A simple WebSocket benchmark in Python

3 thoughts on “A simple WebSocket benchmark in Python”

  1. Sergey says:

    Hi Lemire

    Did you try Aiohttp as a server?

    Also
    I’ve noticed that uvloop wasn’t used. It’s much faster than built in event loop

    1. Did you try Aiohttp as a server?

      I did. It is no faster in my tests.

      I’ve noticed that uvloop wasn’t used. It’s much faster than built in event loop

      I expect at least sanic to use uvloop by default. That is what their documentation says. They even describe how you can disallow uvloop.

  2. Twirrim says:

    Quick nit: You’re missing defining the variable “message” in the client code you uploaded to github.

    pypy saw me go from ~7k to ~11k vs python 3.11 on my laptop using the sanic version (without doing any of the usual stuff around disabling power management etc.)

    It looks like both server and client are both at their speed limits, I had to run both client and server under pypy to get the increased speed, if I ran one or the other under python with the counterpart under pypy, I got the same ~7k.