Not all libraries are as feature-complete as websockets. For a fair benchmark, you should disable features that the other library doesn't provide. Typically, you may need to disable:
Compression: set compression=None
Keepalive: set ping_interval=None
UTF-8 decoding: send bytes rather than str
In the docs: https://github.com/python-websockets/websockets/blob/adfb8d69a7a1f6f4c8381c9e7182619d202c3cf2/docs/faq/misc.rst#L58
It is stated:
Where do we set all these options in the code?