lower the number of allocations in broadcastwriter#8041
lower the number of allocations in broadcastwriter#8041crosbymichael merged 2 commits intomoby:masterfrom
Conversation
|
The benchmarks are impressive but we need to find a way of managing the code generation if we think it's a good compromise using ffjson. |
There was a problem hiding this comment.
Am I right that we need change this on every code regeneration? Could you pls provide benchmark comparison with "vanilla" ffjson code and modified?
c30c27f to
305b9c1
Compare
305b9c1 to
df29f8a
Compare
There was a problem hiding this comment.
I wonder whether this should rather be in a jsonutils package instead.
There was a problem hiding this comment.
@tiborvass I guess it could be timeutils or jsonutils at this point. I'm not sure what other JSON or time related utils we'll add and that's what makes it difficult to decide at this point where we should add it.
There was a problem hiding this comment.
Aha, we can move utils.RFC3339NanoFixed here!
|
I'm getting test failures: --- FAIL: TestLogsTimestamps (0.45 seconds)
docker_cli_logs_test.go:98: Expected log 101 lines, received 1308
[PASSED]: logs - separate stderr (without pseudo-tty)
[PASSED]: logs - stderr in stdout (with pseudo-tty)
--- FAIL: TestLogsTail (0.58 seconds)
docker_cli_logs_test.go:200: Expected log 101 lines, received 1193 |
dffce2e to
d1214b7
Compare
|
@crosbymichael Thanks for checking it out! I've updated the PR to fix the problem. |
d1214b7 to
e5dee84
Compare
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <[email protected]> (github: unclejack)
There was a problem hiding this comment.
I believe you can use WriteByte to not allocate slice.
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <[email protected]> (github: unclejack)
e5dee84 to
9851e8c
Compare
|
Here is my results: LGTM |
|
LGTM |
…iter lower the number of allocations in broadcastwriter
This PR changes the JSONLog marshalling to use custom code for marshalling. This helps improve performance and to lower the amount of allocated memory.
initial to V1
initial to V2
V1 to V2
Fixes #3040
Fixes #7757