mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 02:10:26 +00:00
The microtask queue is a pure FIFO (enqueue at back, dequeue from front) but was using a Vector, making every dequeue O(n) due to element shifting. Replace it with AK::Queue which has O(1) dequeue. This makes a huge difference when processing large numbers of microtasks, e.g. during async-heavy JavaScript workloads where each `await` generates a microtask. Also add a for_each() method to AK::Queue so the GC can visit the queued tasks. |
||
|---|---|---|
| .. | ||
| EventLoop.cpp | ||
| EventLoop.h | ||
| Task.cpp | ||
| Task.h | ||
| TaskQueue.cpp | ||
| TaskQueue.h | ||