Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

arturmelanchyk
Copy link
Contributor

avoid unneeded bool allocation

@Elbehery
Copy link
Member

Elbehery commented Sep 9, 2025

Thanks for your contribution 🙏🏽

imho, code clarity here is more convenient than saving the bool allocation.

I used to follow the same approach always thinking that could have perf impact, however i realized that using the bool as val, make the code more clear and easier to follow, specially when asserting the presence of a key, which is the case here.

That being said, i believe we need benchmarks in order to prove the perf gains.

Wdyt @ahrtr @ivanvc @fuweid

@ivanvc
Copy link
Member

ivanvc commented Sep 10, 2025

/ok-to-test

@ivanvc
Copy link
Member

ivanvc commented Sep 10, 2025

Hi @arturmelanchyk, Thanks for the pull request. Please ensure your commit is signed so the developer certificate of origin (DCO) check passes, i.e:

git rebase HEAD~1 --signoff
git push --force

Thanks again :)

Ref: https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#commit-your-change

@arturmelanchyk arturmelanchyk changed the title perf: make pcache a map of struct{} internal/freelist: make pcache a map of struct{} Sep 10, 2025
Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

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

LGTM & thx

Copy link
Member

@ivanvc ivanvc left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks, @arturmelanchyk

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, arturmelanchyk, ivanvc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Elbehery
Copy link
Member

@arturmelanchyk would u kindly rebase against upstream/main

it has the fix for the windows timeout :)

@ahrtr
Copy link
Member

ahrtr commented Sep 11, 2025

@arturmelanchyk would u kindly rebase against upstream/main

it has the fix for the windows timeout :)

It's fine. Let's merge this PR.

@ahrtr ahrtr merged commit c15b3f4 into etcd-io:main Sep 11, 2025
43 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants