Issues with sending @ >= 1Mbps

69 views
Skip to first unread message

Sarang Karandikar

unread,
Oct 25, 2021, 1:19:48 PM10/25/21
to emscripte...@googlegroups.com
Hello team,

I'm facing some issues with sending WebSocket data at rate >= 1Mbps using emscripten_websocket_send_binary(). It appears that if I generate and send data at around rate >= 500 kbps and try to send it using WebSocket API, the entire UI thread start slowing down rendering to 0.1 FPS, as measured by executions latency of callbacks in emscripten_sync_run_in_main_runtime_thread() function. If sending of data is stopped, it immediately makes the UI more responsive as seen by quick execution of the callbacks.

For reference, speedtest shows ADSL uploads at 5.5 Mbps so I don't see how (and really, why) sending out data on UI thread should stall thread's processing so much so that any other callbacks in emscripten_sync_run_in_main_runtime_thread() starve for attention.

I'm using emscripten version 2.0.32.

Thanks,
Sarang.

Jukka Jylänki

unread,
Oct 25, 2021, 2:11:42 PM10/25/21
to emscripte...@googlegroups.com
What is the message size that you are sending with
emscripten_websocket_send_binary()? If it is relatively small, it is
good to benchmark the number of send events/second rather than the
number of bytes/second.

If the send size is large, would you have a self-contained test case
available that could be used to reproduce the issue in a lab
environment?
> --
> You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAHqdETytFUWeK8ZLfZ3w%2BLEN%3Dxy6zQ0-nw5JZ0cEwg1fBMD3yg%40mail.gmail.com.

Sarang Karandikar

unread,
Oct 25, 2021, 2:19:08 PM10/25/21
to emscripte...@googlegroups.com
Message size 1200 bytes, called 100 times a second on a timer. There are other calls which happen via the main thread quite often but don't cause any such slowdowns.
I will try to get a small test case in.

Thanks,
Sarang.

Reply all
Reply to author
Forward
0 new messages