Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Collapse revision context into specialized context to avoid allocations #11009

Merged
merged 3 commits into from
Mar 23, 2021

Conversation

markusthoemmes
Copy link
Contributor

@markusthoemmes markusthoemmes commented Mar 23, 2021

Proposed Changes

Always wanted to play with custom value contexts, so here we are! This spares us a bit of linked list lookup and context allocation, so yay!

benchmark                                                         old ns/op     new ns/op     delta
BenchmarkContextHandler/context_handler_success-sequential-16     923           841           -8.88%
BenchmarkContextHandler/context_handler_success-parallel-16       176           166           -5.68%
BenchmarkContextHandler/context_handler_failure-sequential-16     15401         11938         -22.49%
BenchmarkContextHandler/context_handler_failure-parallel-16       11216         11829         +5.47%

benchmark                                                         old allocs     new allocs     delta
BenchmarkContextHandler/context_handler_success-sequential-16     7              6              -14.29%
BenchmarkContextHandler/context_handler_success-parallel-16       7              6              -14.29%
BenchmarkContextHandler/context_handler_failure-sequential-16     38             38             +0.00%
BenchmarkContextHandler/context_handler_failure-parallel-16       38             38             +0.00%

benchmark                                                         old bytes     new bytes     delta
BenchmarkContextHandler/context_handler_success-sequential-16     592           560           -5.41%
BenchmarkContextHandler/context_handler_success-parallel-16       592           560           -5.41%
BenchmarkContextHandler/context_handler_failure-sequential-16     3944          4111          +4.23%
BenchmarkContextHandler/context_handler_failure-parallel-16       3663          3942          +7.62%

Release Note

NONE

/assign @julz @vagababov

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Mar 23, 2021
@knative-prow-robot knative-prow-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/autoscale area/networking labels Mar 23, 2021
@codecov
Copy link

codecov bot commented Mar 23, 2021

Codecov Report

Merging #11009 (df06d78) into main (4e5fde5) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #11009   +/-   ##
=======================================
  Coverage   87.97%   87.97%           
=======================================
  Files         188      188           
  Lines        9115     9116    +1     
=======================================
+ Hits         8019     8020    +1     
- Misses        840      841    +1     
+ Partials      256      255    -1     
Impacted Files Coverage Δ
pkg/activator/handler/context.go 100.00% <100.00%> (ø)
pkg/activator/handler/context_handler.go 95.83% <100.00%> (-0.17%) ⬇️
pkg/activator/net/revision_backends.go 90.41% <0.00%> (-0.92%) ⬇️
pkg/autoscaler/statforwarder/leases.go 78.41% <0.00%> (+1.43%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e5fde5...df06d78. Read the comment docs.

Copy link
Member

@julz julz left a comment

Choose a reason for hiding this comment

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

👍

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 23, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: julz

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 23, 2021
@knative-prow-robot knative-prow-robot merged commit 3e2b15e into knative:main Mar 23, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/autoscale area/networking cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. 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.

4 participants