ysbaddaden / execution_context

10 stars 2 forks source link

Mixing different types of loads: network, file, CPU #33

Open beta-ziliani opened 2 months ago

beta-ziliani commented 2 months ago

Here EC really shines. With -Dpreview_mt -Dec -Dmt it gets 1.8 req/s, while with just -Dpreview_mt it's less than 0.5. This is expected: if two CPU heavy tasks end in the same thread, since there's no snatching of tasks, it swamps the thread that then can't take further tasks.

ysbaddaden commented 2 months ago

Even if both CPU heavy tasks only block one thread, preview_mt keeps to round-robin spawn fibers to each threads, so 1/N of them will be sent to the blocked thread.