cross-posted from: https://lemm.ee/post/39429103

You are viewing a single thread.
View all comments View context
1 point

Yes, but with WebSocket you need to have a server and that will consume some additional CPU.

Without it you only need some random CDN to do the download test.

permalink
report
parent
reply
1 point

This server is just a piece of software that accepts and responds to TCP sockets. It could be anything, but you’re not consuming more CPU power by doing less work.

The http protocol requires you prepend every message with a bunch of headers and for them to have a static size. (tho plenty of apps allow you to bend the rules quite a bit)

After switching to a websocket, none of that applies. You can just dump data straight into the TCP socket. Or TLS stream that goes into the TCP socket. But that would be same for the http requests

permalink
report
parent
reply
1 point
*

On the server side to send you data, using any web server with mmap support will probably be less CPU intensive than app that handles websocket, but yes, the details matter as when reading a lot of small files vs websocket, then websocket could be better for CPU usage especially when you could generate data.

But once again using plain old http allow you to use the speestest software against any CDN very easy IMO.

permalink
report
parent
reply
1 point

Adding headers and some other minor requirements is slower than not. That’s really the difference, it’s not complicated.

permalink
report
parent
reply

Opensource

!opensource@programming.dev

Create post

A community for discussion about open source software! Ask questions, share knowledge, share news, or post interesting stuff related to it!

Credits

Icon base by Lorc under CC BY 3.0 with modifications to add a gradient



Community stats

  • 937

    Monthly active users

  • 144

    Posts

  • 397

    Comments

Community moderators