The Wayback Machine - https://web.archive.org/web/20200705014514/https://github.com/google/open-location-code/issues/241
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

Add benchmark code to tests #241

Open
drinckes opened this issue Nov 28, 2018 · 1 comment
Open

Add benchmark code to tests #241

drinckes opened this issue Nov 28, 2018 · 1 comment
Labels

Comments

@drinckes
Copy link
Collaborator

@drinckes drinckes commented Nov 28, 2018

We should add benchmarking code to the tests so that performance impact of code changes can be identified.

Since the travis CI runs the tests on every pull, this should make performance testing of changes easy.

drinckes added a commit that referenced this issue Nov 28, 2018
See #241 .

Example output:

BenchmarkEncode-2   	 2000000	       950 ns/op	     112 B/op	       6 allocs/op
BenchmarkDecode-2   	 2000000	       859 ns/op	     176 B/op	       6 allocs/op

The numbers are 1) the number of ops, 2) the time per op, 3) distinct memory allocations occurred per op, and 4) how many bytes were allocated per op.

An encode took 950 nanoseconds, a decode 859 nanoseconds, so they are both a bit more than a million operations per second.
@drinckes
Copy link
Collaborator Author

@drinckes drinckes commented Nov 28, 2018

Go benchmarks added in #240

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.