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

remove defer keyword to avoid overhead #53

Merged
merged 1 commit into from
Feb 27, 2019

Conversation

guanw
Copy link
Contributor

@guanw guanw commented Feb 27, 2019

This is to address improvement I brought up here.

based on https://medium.com/i0exception/runtime-overhead-of-using-defer-in-go-7140d5c40e32, we could remove the most of the defer statement to avoid overhead. This should boost the performance even more. (Let me know if we need a benchmark to prove it?)

@hashicorp-cla
Copy link

hashicorp-cla commented Feb 27, 2019

CLA assistant check
All committers have signed the CLA.

@guanw guanw mentioned this pull request Feb 27, 2019
Copy link
Member

@jefferai jefferai left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@jefferai jefferai merged commit 7087cb7 into hashicorp:master Feb 27, 2019
@guanw guanw deleted the judew-remove-defer branch February 28, 2019 16:27
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Oct 23, 2019
full diff: hashicorp/golang-lru@0fb14ef...v0.5.3

- hashicorp/golang-lru#53 remove defer keyword to avoid overhead
- hashicorp/golang-lru#56 lru.Get(): avoid nil pointer dereference
- hashicorp/golang-lru#57 Adds LRU cache resize
- hashicorp/golang-lru#58 lru: don't kill the return values of Remove and RemoveOldest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Oct 24, 2019
full diff: hashicorp/golang-lru@0fb14ef...v0.5.3

- hashicorp/golang-lru#53 remove defer keyword to avoid overhead
- hashicorp/golang-lru#56 lru.Get(): avoid nil pointer dereference
- hashicorp/golang-lru#57 Adds LRU cache resize
- hashicorp/golang-lru#58 lru: don't kill the return values of Remove and RemoveOldest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Dec 10, 2019
full diff: hashicorp/golang-lru@0fb14ef...v0.5.3

- hashicorp/golang-lru#53 remove defer keyword to avoid overhead
- hashicorp/golang-lru#56 lru.Get(): avoid nil pointer dereference
- hashicorp/golang-lru#57 Adds LRU cache resize
- hashicorp/golang-lru#58 lru: don't kill the return values of Remove and RemoveOldest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Dec 12, 2019
full diff: hashicorp/golang-lru@0fb14ef...v0.5.3

- hashicorp/golang-lru#53 remove defer keyword to avoid overhead
- hashicorp/golang-lru#56 lru.Get(): avoid nil pointer dereference
- hashicorp/golang-lru#57 Adds LRU cache resize
- hashicorp/golang-lru#58 lru: don't kill the return values of Remove and RemoveOldest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Jan 6, 2020
full diff: hashicorp/golang-lru@0fb14ef...v0.5.3

- hashicorp/golang-lru#53 remove defer keyword to avoid overhead
- hashicorp/golang-lru#56 lru.Get(): avoid nil pointer dereference
- hashicorp/golang-lru#57 Adds LRU cache resize
- hashicorp/golang-lru#58 lru: don't kill the return values of Remove and RemoveOldest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 4b267469b9b4769ac5f8a2cf3fa5e640efdc201e
Component: cli
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.

3 participants