Skip to content

Conversation

@mheon
Copy link
Member

@mheon mheon commented Mar 25, 2019

We have a very high performance JSON library that doesn't need to perform code generation. Let's use it instead of our questionably performant, reflection-dependent deep copy library.

Most changes because some functions can now return errors.

Also converts cmd/podman to use jsoniter, instead of pkg/json, for increased performance.

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mheon

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

The pull request process is described here

Details 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-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL labels Mar 25, 2019
@rhatdan
Copy link
Member

rhatdan commented Mar 26, 2019

LGTM

@TomSweeneyRedHat
Copy link
Member

All kinds of test unhappiness @mheon

@mheon
Copy link
Member Author

mheon commented Mar 26, 2019

It's our good old friend jsoniterator, which has a firm belief that it should panic the program if someone tries to indent JSON with tabs, not spaces.

@mheon
Copy link
Member Author

mheon commented Mar 26, 2019

Fixed by replacing a \t with five spaces

cmd/podman/ps.go Outdated
@@ -647,7 +646,7 @@ func printFormat(format string, containers []shared.PsContainerOutput) error {
}

func dumpJSON(containers []shared.PsContainerOutput) error {
b, err := json.MarshalIndent(containers, "", "\t")
b, err := json.MarshalIndent(containers, "", " ")
Copy link
Member

Choose a reason for hiding this comment

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

ugh

@TomSweeneyRedHat
Copy link
Member

Changes LGTM, tests are getting a lot closer, but still not all in yet.

@mheon mheon force-pushed the misc_small_changes branch from 7b8d2e2 to a691d12 Compare March 26, 2019 17:40
mheon added 3 commits March 27, 2019 20:00
We have a very high performance JSON library that doesn't need to
perform code generation. Let's use it instead of our questionably
performant, reflection-dependent deep copy library.

Most changes because some functions can now return errors.

Also converts cmd/podman to use jsoniter, instead of pkg/json,
for increased performance.

Signed-off-by: Matthew Heon <[email protected]>
Signed-off-by: Matthew Heon <[email protected]>
The jsoniterator library believes that panic() is a reasonable
response to being told to indent JSON with a tab. So use spaces
instead.

Signed-off-by: Matthew Heon <[email protected]>
@mheon mheon force-pushed the misc_small_changes branch from a691d12 to 179a66f Compare March 28, 2019 00:00
@mheon
Copy link
Member Author

mheon commented Mar 28, 2019

Rebased, CI should be happy now

@rhatdan
Copy link
Member

rhatdan commented Mar 28, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 28, 2019
@mheon mheon added lgtm Indicates that a PR is ready to be merged. and removed lgtm Indicates that a PR is ready to be merged. labels Mar 28, 2019
@openshift-merge-robot openshift-merge-robot merged commit e7a2eec into containers:master Mar 28, 2019
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants