-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize method PoolChunk.allocate(...) to reduce overhead (#13528)
Motivation: When goes into method `PoolChunk.allocate(...)`, we need to check whether `head.next == head`, it has been checked before in method `PoolArena.tcacheAllocateSmall(...)`, but `head.next` may have been changed after that, so it needs to be checked again. This can lower the chance to call `PoolChunk.allocateSubpage(...)` and `PoolChunk.allocateRun(...)`, so will reduce overhead. Modification: Check whether `head.next == head` in method `PoolChunk.allocate(...)`. Result: Lower the chance of calling `PoolChunk.allocateSubpage(...)` and `PoolChunk.allocateRun(...)` to reduce overhead. Co-authored-by: laosijikaichele <laosijikaichele>
- Loading branch information
1 parent
5cb4974
commit ec9875d
Showing
1 changed file
with
40 additions
and
28 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