Crates.io | smolscale |
lib.rs | smolscale |
version | 0.4.11 |
source | src |
created_at | 2020-10-26 22:21:48.149786 |
updated_at | 2024-08-29 14:29:16.690056 |
description | A high-performance async-task scheduler |
homepage | |
repository | https://github.com/geph-official/smolscale |
max_upload_size | |
id | 305767 |
size | 68,075 |
A global, auto-scaling scheduler for [async-task] using work-balancing.
smolscale
is a work-balancing executor based on [async-task], designed to be a drop-in replacement to smol
and async-global-executor
. It is designed based on the idea that work-stealing, the usual approach in async executors like async-executor
and tokio
, is not the right algorithm for scheduling huge amounts of tiny, interdependent work units, which are what message-passing futures end up being. Instead, smolscale
uses work-balancing, an approach also found in Erlang, where a global "balancer" thread periodically balances work between workers, but workers do not attempt to steal tasks from each other. This avoids the extremely frequent stealing attempts that work-stealing schedulers generate when applied to async tasks.
smolscale
's approach especially excels in two circumstances:
smolscale
will instead drastically reduce CPU usage in these circumstances --- a async-executor
app that takes 80% of CPU time may now take only 20%. Although this does not improve fully-loaded throughput, it significantly reduces power consumption and does increase throughput in circumstances where multiple thread pools compete for CPU time.smolscale
can significantly improve throughput, especially compared to executors like async-executor
that do not special-case message passing.License: ISC