You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid unnecessary copies of AVIF primary_item and alpha_item
When they're already contiguously present in an mdat buffer (even the same one),
AvifContext::primary_item() and ::alpha_item() can return slices rather than
having to copy the (potentially large) buffers.
This results in a measured performance increase of ~50% for parsing a 4.7 MB
AVIF (the largest in our test set):
$ git checkout master
$ cargo bench -- --save-baseline base
avif_largest time: [2.0990 ms 2.1352 ms 2.1727 ms]
$ git checkout avif-nocopy
$ cargo bench -- --save-baseline avif-nocopy
$ cargo bench -- --load-baseline avif-nocopy --baseline base
avif_largest time: [1.0077 ms 1.0257 ms 1.0449 ms]
change: [-52.649% -51.371% -50.022%] (p = 0.00 < 0.05)
Performance has improved.
Also, clean up some related code add add tests.
0 commit comments