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

Merged
merged 2 commits into from
Sep 15, 2020
Merged

Add benchmark #401

merged 2 commits into from
Sep 15, 2020

Conversation

zhouzhuojie
Copy link
Collaborator

Description

Add go test -bench for critical flag evaluation code path, so that we can track of performance regression.

Motivation and Context

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@zhouzhuojie
Copy link
Collaborator Author

Some result:
https://app.circleci.com/pipelines/github/checkr/flagr/68/workflows/602bf13e-fd01-4cd3-87fe-59b28b8cf1f5/jobs/1482/parallel-runs/0/steps/0-105

PASS
ok  	github.com/checkr/flagr/pkg/config	0.103s
PASS
ok  	github.com/checkr/flagr/pkg/entity	0.277s
goos: linux
goarch: amd64
pkg: github.com/checkr/flagr/pkg/handler
BenchmarkEvalFlag-36           	   40384	     29396 ns/op	    1640 B/op	      36 allocs/op
BenchmarkEvalFlagsByTags-36    	   38822	     31579 ns/op	    1647 B/op	      35 allocs/op
PASS
ok  	github.com/checkr/flagr/pkg/handler	3.308s
?   	github.com/checkr/flagr/pkg/mapper/entity_restapi/e2r	[no test files]
?   	github.com/checkr/flagr/pkg/mapper/entity_restapi/r2e	[no test files]
PASS
ok  	github.com/checkr/flagr/pkg/util	0.031s
CircleCI received exit code 0

@zhouzhuojie zhouzhuojie merged commit 687704c into master Sep 15, 2020
@zhouzhuojie zhouzhuojie deleted the zz/add-benchmark branch September 15, 2020 23:15
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.

1 participant