Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve defaultCodec.Decode #122

Closed
wants to merge 1 commit into from

Conversation

Abioy
Copy link

@Abioy Abioy commented Sep 13, 2021

reduce memory copy times and reuse map objects in ttheader decode.

@Abioy Abioy marked this pull request as draft September 13, 2021 13:58
@Abioy Abioy marked this pull request as ready for review September 13, 2021 13:58
@YangruiEmma
Copy link
Member

Thanks @Abioy. But the buffer is reused, it must be copied here or it will lead panic.

@Abioy
Copy link
Author

Abioy commented Sep 14, 2021

Thanks @Abioy. But the buffer is reused, it must be copied here or it will lead panic.

@YangruiEmma Yes, buffer was copied in line 266 of header_codec.go within #122 .

@YangruiEmma
Copy link
Member

Thanks @Abioy. But the buffer is reused, it must be copied here or it will lead panic.

@YangruiEmma Yes, buffer was copied in line 266 of header_codec.go within #122 .

From the perf test, read modification doesn't promote performance obviously. But the map reuse may be a point, this modification can be kept if the performance result is better.

@lsjbd lsjbd linked an issue Jan 20, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: reduce overhead of defaultCodec.Decode
2 participants