Closed Bug 1509226 Opened Last year Closed Last year
Avoid allocations to define clips
47 bytes, text/x-phabricator-request
|Details | Review|
Both versions of DefineClipChain use an nsTArray to collect the clips to be defined, which means at least 2 allocations for every new clip we encounter. The two types (wr::WrClipId and size_t) are the same thing in-memory, so we should be able to use a single vector, and AutoTArray should stop us from allocating in all but the most extreme cases. Doing this removes a few % from WR command building time.
I filed something like this in bug 1506172.
See Also: → 1506172
Uploading my patch anyway, since it's done. I think we could land it now, and do the conversion to the properly exported rust type in 1506172 once the clip cleanup is done. Or we could just wait, it's not a huge performance difference. I don't mind.
MozReview-Commit-ID: CetmS5cZCMP Depends on D12720
I'd rather use the same WrClipId in both places instead of asserting that size_t is the same type.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/d6509279d52e Avoid allocations to serialize clips. r=jrmuizel
You need to log in before you can comment on or make changes to this bug.