Will Beason

Results 41 comments of Will Beason

The benchmark I'm using: https://gist.github.com/willbeason/9c8e2a570baeeee946f9f9c7fd26359e

For callers who have objects with a DeepCopy-like method defined, the savings are ~90% instead of ~99% if the caller is not able to guarantee the object will remain unmutated...

Thinking further a "good enough" solution for us would be to do the round-tripping validation _without_ needing to acquire the write lock on the storage. That would enable both the...

The other side effect you get of round-tripping through JSON is an implicit deepcopy of the entire struct. So if we _only_ round-tripped subfields which were not native JSON types,...

From looking at open PRs and Issues - unfortunately [json-iterator](https://github.com/json-iterator/go) doesn't look like it is actively maintained.

Confirmed it is ~10x faster to do what @srenatus suggests: ``` ~/frameworks/constraint$ go test ./pkg/client/drivers/local/ --run=NONE --bench=. goos: linux goarch: amd64 pkg: github.com/open-policy-agent/frameworks/constraint/pkg/client/drivers/local cpu: Intel(R) Xeon(R) CPU @ 2.20GHz BenchmarkStorages_AddData/structured-16...

With the JSONify deepcopy, it is only 4x faster. It is possible that won't fully resolve our issue so I'll send a follow-up to reduce the time the write-lock is...

(Edited Issue for YAML formatting)

Can you provide an example Pod which does not produce the results you expect?

Note that for testing for equality, you need to use `==` ``` input.review.kind.kind == "Pod" input.review.operation == "CREATE" ```