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

chore: remove reflection zero type when zero value is known (PROJQUAY-6620) #112

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

arborite-rh
Copy link
Contributor

@arborite-rh arborite-rh commented Feb 28, 2024

reflection uses unsafe types and is cpu intensive. we can reduce cpu
cycles on every api call by simple comparing an empty strings equality
to the value of the AuthToken.

strings.EqualFold is a std lib solution that provides similar
functionality, but that is not necessary for comparing empty strings as
it simply uses the standard equality operator as well

Topic: rm-reflection

Relative: projquay-6620
Signed-off-by: Ross Bryan robryan@redhat.com

@arborite-rh
Copy link
Contributor Author

arborite-rh commented Feb 28, 2024

Reviews in this chain:
#112 chore: remove reflection zero type when zero value is known (PROJQUAY-6620)
 └#113 chore: upgrade go.mod to 1.20 (matches Dockerfile builder) + ioutil deprecation (PROJQUAY-6620)
  └#115 test: unit test/mock quay client (PROJQUAY-6620)

@arborite-rh
Copy link
Contributor Author

arborite-rh commented Feb 28, 2024

# head base diff date summary
0 7fd04c75 c39e6d24 diff Feb 27 21:18 PM 3 files changed, 240 insertions(+), 8 deletions(-)
1 4c076221 c39e6d24 diff Feb 27 21:21 PM 2 files changed, 1 insertion(+), 240 deletions(-)
2 ecb31c30 e2effef4 rebase Mar 6 13:19 PM 0 files changed
3 96f5a360 e2effef4 diff Mar 6 13:23 PM 0 files changed
4 fe678d01 e2effef4 diff Mar 6 13:24 PM 0 files changed

…-6620)

reflection uses unsafe types and is cpu intensive. we can reduce cpu
cycles on every api call by simple comparing an empty strings equality
to the value of the AuthToken.

strings.EqualFold is a std lib solution that provides similar
functionality, but that is not necessary for comparing empty strings as
it simply uses the standard equality operator as well

Topic: rm-reflection

Relative: projquay-6620
Signed-off-by: Ross Bryan <robryan@redhat.com>
@arborite-rh arborite-rh force-pushed the rb/revup/master/rm-reflection branch from ecb31c3 to 96f5a36 Compare March 6, 2024 18:23
@arborite-rh arborite-rh changed the title chore: remove reflection zero type when zero value is known chore: remove reflection zero type when zero value is known (PROJQUAY-6620) Mar 6, 2024
@arborite-rh arborite-rh force-pushed the rb/revup/master/rm-reflection branch from 96f5a36 to fe678d0 Compare March 6, 2024 18:24
@dmage
Copy link
Member

dmage commented Mar 7, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Mar 7, 2024
Copy link
Contributor

openshift-ci bot commented Mar 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: arborite-rh, dmage

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

@openshift-ci openshift-ci bot added the approved label Mar 7, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 85db6f5 into master Mar 7, 2024
9 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.

None yet

2 participants