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

Eliminate []byte(string) allocation under thrift transport #729

Merged
merged 1 commit into from
Apr 1, 2019

Conversation

jcorbin
Copy link
Contributor

@jcorbin jcorbin commented Mar 29, 2019

No description provided.

@jcorbin jcorbin requested a review from prashantv March 29, 2019 21:38
Copy link
Contributor

@prashantv prashantv left a comment

Choose a reason for hiding this comment

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

Looks like we have code coverage for both paths (writer implements WriteString or does not).

b := append(t.strBuf[:0], s...)
t.strBuf = b[:0]
return t.Writer.Write(b)

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: delete blank line

@codecov
Copy link

codecov bot commented Apr 1, 2019

Codecov Report

Merging #729 into dev will decrease coverage by 0.22%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #729      +/-   ##
==========================================
- Coverage   87.77%   87.55%   -0.23%     
==========================================
  Files          40       40              
  Lines        4075     4075              
==========================================
- Hits         3577     3568       -9     
- Misses        377      388      +11     
+ Partials      121      119       -2
Impacted Files Coverage Δ
connection.go 84.59% <0%> (-2.21%) ⬇️
mex.go 72.09% <0%> (-1.87%) ⬇️
preinit_connection.go 92.7% <0%> (-1.46%) ⬇️
peer.go 93.81% <0%> (+0.36%) ⬆️
relay.go 82.09% <0%> (+0.61%) ⬆️
outbound.go 87.93% <0%> (+1.72%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a255dc1...cd8e8c7. Read the comment docs.

@jcorbin jcorbin merged commit 016d215 into dev Apr 1, 2019
@jcorbin jcorbin deleted the thrift_write_string_alloc branch April 1, 2019 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants