mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
`take_first()` on a Vector is O(n), meaning this function used to have
O(n^2) behavior in the width of an image.
We can just use a span instead, which can be be advanced in O(1) time.
Makes
pdf --debugging-stats ~/Downloads/ignition.pdf
go from 10.2s to 6.7s, 34% faster.
Makes the first 50 pages of
pdf --debugging-stats pdf-stuff/Mellor_ACTITC_10.pdf
go from 65.9s to 13.2s, 80% faster.
Fixes #26082.