mirrored from https://chromium.googlesource.com/angle/angle
-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize HandleAllocator for fast ID churning.
Instead of calculating ranges of IDs and the overhead with updating them every allocation/release, store a released ID list in a small FastVector. Optimize the allocate path for the "good case" of no reserved IDs so that it either pops the last released ID or incriments a next value and returns it. Release has a similar cost of just a push_back when there are no reserved IDs. This adds a small fixed memory cost due to the FastVector and a dynamic memory cost of mReleasedList having up to N elements where N is the maxmimum total handles allocated at one time. Bug: angleproject:8434 Change-Id: I7c5aa126b5303c105cd2464d0d0933b922cc2b8f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5101509 Reviewed-by: Charlie Lao <[email protected]> Commit-Queue: Shahbaz Youssefi <[email protected]>
- Loading branch information
Showing
7 changed files
with
154 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.