Skip to content

Improve BumpPtrAllocator performance #608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2022

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Aug 19, 2022

Eliminate unnecessary slab array access when allocating from the current slab. Also factored out "allocate from the current slab" to a function.

@rintaro rintaro requested a review from ahoppen as a code owner August 19, 2022 06:58
@rintaro rintaro changed the title Improve BumpPointerAllocator performance Improve BumpPtrAllocator performance Aug 19, 2022
Eliminate unnecessary slab array access when allocating from the current
slab. Also factored out "allocate from the current slab" to a function.
@rintaro rintaro force-pushed the bump-ptr-allocator-perf branch from 4d7d64e to db3c85e Compare August 19, 2022 06:59
@@ -79,12 +98,8 @@ public class BumpPtrAllocator {
_totalBytesAllocated += byteCount

// Check if the current slab has enough space.
if !slabs.isEmpty {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the "unnecessary slab array access."

@rintaro
Copy link
Member Author

rintaro commented Aug 19, 2022

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Aug 19, 2022

@swift-ci Please test Linux

@rintaro rintaro merged commit 71f1af4 into swiftlang:main Aug 19, 2022
@rintaro rintaro deleted the bump-ptr-allocator-perf branch August 19, 2022 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants