Skip to content
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

Merged
merged 4 commits into from
Feb 27, 2018
Merged

Performance fixes. #1654

merged 4 commits into from
Feb 27, 2018

Conversation

AWoloszyn
Copy link
Contributor

This fixes #1646.

The performance overhead of libgapii is now actually lower than it was in 1.03.

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");
Copy link
Contributor

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.

@@ -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",
Copy link
Contributor

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

deps = [
"//core/memory/arena/cc",
":headers",
"//core/memory/arena/cc:cc",
Copy link
Contributor

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 &.
@AWoloszyn AWoloszyn merged commit b320ea9 into google:master Feb 27, 2018
@AWoloszyn AWoloszyn deleted the map-update branch May 8, 2018 13:23
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.

Tracing performance regression from 1.0.3 -> master.
2 participants