sv / kdbgo

kdb+ client driver for Go
MIT License
44 stars 29 forks source link

Avoid extra allocation in Encode #20

Closed yznima closed 5 years ago

yznima commented 5 years ago

Avoid extra allocation to increase performance when encoding to QIPC.

Before

Starting q process on random port
Listening port is  64211
goos: darwin
goarch: amd64
pkg: github.com/sv/kdbgo
BenchmarkEncodeAll-8       30000         48148 ns/op
PASS
Q stdout output: "show `exiting_process;\n"

Q stdout output: `exiting_process

Q stdout output: "exit 0\n"

Q stdout output:
Q stdout error: EOF
Q stderr output:
Q stderr error: EOF
ok      github.com/sv/kdbgo 2.013s

After

Starting q process on random port
Listening port is  52052
goos: darwin
goarch: amd64
pkg: github.com/sv/kdbgo
BenchmarkEncodeAll-8      100000         20985 ns/op
PASS
Q stdout output: "show `exiting_process;\n"

Q stdout output: `exiting_process
"exit 0\n"

Q stdout output:
Q stdout error: EOF
Q stderr output:
Q stderr error: EOF
ok      github.com/sv/kdbgo 2.403s
yznima commented 5 years ago

@sv Could you review?

sv commented 5 years ago

Nice PR. Thanks!

yznima commented 5 years ago

@sv Could you re-review

sv commented 5 years ago

Could you update description with new test timing if it has changed?

On Fri, 1 Mar 2019 at 16:30 Nima Yahyazadeh notifications@github.com wrote:

@sv https://github.com/sv Could you re-review

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/sv/kdbgo/pull/20#issuecomment-468724784, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA3Brd8GVHX9OCOMJAIBkBXxvFXrwYmks5vSVWngaJpZM4bYLFF .

yznima commented 5 years ago

Could you update description with new test timing if it has changed?

@sv Done

yznima commented 5 years ago

@sv ready for merge