smol-rs / async-executor

Async executor
Apache License 2.0
334 stars 45 forks source link

v1.12.0 #118

Closed notgull closed 5 months ago

notgull commented 6 months ago
notgull commented 5 months ago

@taiki-e Any chance you can review this? This is blocking performance improvements in Bevy.

(If you don't have time it's already been reviewed by other members so I'm fine publishing this.)

taiki-e commented 5 months ago

Add static executors, which are an optimization over executors that are kept around forever. (https://github.com/smol-rs/async-executor/pull/112)

Is it confirmed that the performance issue is not handled well by inlining?

When I received a similar request on crossbeam before, it could be handled almost well with inlining alone. https://github.com/crossbeam-rs/crossbeam/issues/979#issuecomment-1528824012

notgull commented 5 months ago

Apparently the core issue was the locking of the Mutex used to abort the task when the Executor is dropped. When this Mutex isn't being locked Bevy has observed noticeable performance gains.

notgull commented 5 months ago

Ref: https://github.com/smol-rs/async-executor/pull/112#issuecomment-2059556711

taiki-e commented 5 months ago

Oh, that indeed cannot be handled by inlining.