Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Add a bunch of micro benchmarks.#201

Merged
trotterdylan merged 1 commit intogoogle:masterfrom
nairb774:microBench
Jan 24, 2017
Merged

Add a bunch of micro benchmarks.#201
trotterdylan merged 1 commit intogoogle:masterfrom
nairb774:microBench

Conversation

@nairb774
Copy link
Copy Markdown
Contributor

Method covered by new benchmarks:

  • Dict.GetItem
  • Dict.IterItems
  • Dict.IterKeys
  • Dict.IterValues
  • NewInt - Fixed so that references aren't elided anymore.
  • NewStr

I have some improvements in the Dict area and I thought it might be good to get some benchmarks on the ground first.

Method covered by new benchmarks:
* Dict.GetItem
* Dict.IterItems
* Dict.IterKeys
* Dict.IterValues
* NewInt - Fixed so that references aren't elided anymore.
* NewStr
Copy link
Copy Markdown
Contributor

@trotterdylan trotterdylan left a comment

Choose a reason for hiding this comment

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

This is cool thanks for adding these! The KeepAlive thing is subtle. Did you notice a significant difference in performance with and without? What optimizations necessitate it?

Merging.

@trotterdylan trotterdylan merged commit 4e36b85 into google:master Jan 24, 2017
@nairb774
Copy link
Copy Markdown
Contributor Author

The keep alive (currently) helps prevent the Go compiler from removing the assignment to the variables and getting too clever. In the one case, (NewInt) was basically being inlined away. While I am sure this isn't a correct solution for the long term, it seems to work today. If for some reason a new Go version makes the benchmarks much much faster, then we have some work to do :)

@nairb774 nairb774 deleted the microBench branch January 24, 2017 03:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants