Skip to content

Improve Value and PathElement String() #112

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

Closed
wants to merge 2 commits into from

Conversation

apelisse
Copy link
Contributor

@apelisse apelisse commented Oct 2, 2019

PathElements are frequently turned into strings to find out if a path has already been evaluated. Values are part of PathElements so they are also turned into strings. That's a non-negligible improvement.

benchmark                                   old ns/op     new ns/op     delta
BenchmarkOperations/Pod/Update-12           384166        329574        -14.21%
BenchmarkOperations/Node/Update-12          576277        498512        -13.49%
BenchmarkOperations/Pod/Apply-12            543377        482016        -11.29%
BenchmarkOperations/Node/Apply-12           764054        684379        -10.43%
BenchmarkOperations/Endpoints/Apply-12      2065245       1997567       -3.28%
BenchmarkOperations/Endpoints/Update-12     55470         53943         -2.75%

benchmark                                  old allocs     new allocs     delta
BenchmarkOperations/Node/Update-12         1155           967            -16.28%
BenchmarkOperations/Node/Apply-12          1876           1581           -15.72%
BenchmarkOperations/Pod/Update-12          843            727            -13.76%
BenchmarkOperations/Pod/Apply-12           1179           1024           -13.15%
BenchmarkOperations/Endpoints/Apply-12     3142           3043           -3.15%

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 2, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: apelisse

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 2, 2019
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 2, 2019
@lavalamp
Copy link
Contributor

lavalamp commented Oct 2, 2019

PathElements are frequently turned into strings to find out if a path has already been evaluated

Where? This shouldn't be done?

@lavalamp
Copy link
Contributor

lavalamp commented Oct 2, 2019

We should just store the path or path element and use Less (and/or use or implement Equals if not already).

@apelisse
Copy link
Contributor Author

apelisse commented Oct 2, 2019

Will replace with something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants