OCPBUGS-17157: cache/json: use shared buffers for JSON decoding#1140
Conversation
This commit uses a shared buffer in a shared decoder for the ListBundles call, which should reduce our memory footprint when we're asked for this data. I also changed the sorting of the key-set to be an explicit call to sort.Slice, instead of an implicit side-effect from sets.New().List(). Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
|
@stevekuznetsov: This pull request references Jira Issue OCPBUGS-17157, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/assign @joelanford @grokspawn |
|
Local testing only shows modest improvements, but these will be true regardless of GC performance, whereas Here's the |
| // The SQLite-based server | ||
| // configures its querier to | ||
| // omit these fields when | ||
| // key path is set. |
There was a problem hiding this comment.
nit:
| // key path is set. | |
| // bundle path is set. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: grokspawn, stevekuznetsov The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
awgreene
left a comment
There was a problem hiding this comment.
One question, looks good otherwise.
| sort.Slice(keys, func(i, j int) bool { | ||
| if keys[i].chName != keys[j].chName { | ||
| return keys[i].chName < keys[j].chName | ||
| } | ||
| if keys[i].pkgName != keys[j].pkgName { | ||
| return keys[i].pkgName < keys[j].pkgName | ||
| } | ||
| return keys[i].name < keys[j].name | ||
| }) |
There was a problem hiding this comment.
Why are we ordering the list here?
There was a problem hiding this comment.
The ordering existed before, I just made it explicit. I imagine consumers (or tests) of this output benefit from a stable list.
|
@stevekuznetsov: Jira Issue OCPBUGS-17157: Some pull requests linked via external trackers have merged:
The following pull requests linked via external trackers have not merged: These pull request must merge or be unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with Jira Issue OCPBUGS-17157 has not been moved to the MODIFIED state. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This commit uses a shared buffer in a shared decoder for the ListBundles call, which should reduce our memory footprint when we're asked for this data.
I also changed the sorting of the key-set to be an explicit call to sort.Slice, instead of an implicit side-effect from sets.New().List().