Skip to content

Comments

Performance fixes.#1654

Merged
AWoloszyn merged 4 commits intogoogle:masterfrom
AWoloszyn:map-update
Feb 27, 2018
Merged

Performance fixes.#1654
AWoloszyn merged 4 commits intogoogle:masterfrom
AWoloszyn:map-update

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.

#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.

"//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