-
Notifications
You must be signed in to change notification settings - Fork 327
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
Performance fixes. #1654
Performance fixes. #1654
Conversation
Replace % with bitwise arithmetic. This helps reduce the performance regression seen between 1.03 and master.
This is a significant performance improvement.
@@ -22,6 +22,9 @@ | |||
|
|||
#include <unordered_map> | |||
|
|||
static_assert((GAPIL_MIN_MAP_SIZE & (GAPIL_MIN_MAP_SIZE - 1)) == 0, "Map size must be a power of 2"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth putting a similar assert in the compiler.
gapii/cc/BUILD.bazel
Outdated
@@ -142,7 +142,7 @@ cc_library( | |||
"//core/memory/arena/cc", | |||
"//core/memory_tracker/cc", | |||
"//core/os/device/deviceinfo/cc", | |||
"//gapil/runtime/cc", | |||
"//gapil/runtime/cc:cc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be no need for the :cc
gapil/runtime/cc/BUILD.bazel
Outdated
deps = [ | ||
"//core/memory/arena/cc", | ||
":headers", | ||
"//core/memory/arena/cc:cc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for :cc
We require that they are a power of 2, otherwise we have to fall back to a slow % operator, instead of &.
This fixes #1646.
The performance overhead of libgapii is now actually lower than it was in 1.03.