-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[ws-daemon] Improve path concatenation #5143
Conversation
/hold |
Codecov Report
@@ Coverage Diff @@
## main #5143 +/- ##
=========================================
+ Coverage 0 23.10% +23.10%
=========================================
Files 0 11 +11
Lines 0 1922 +1922
=========================================
+ Hits 0 444 +444
- Misses 0 1419 +1419
- Partials 0 59 +59
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -86,7 +87,10 @@ func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error) | |||
} | |||
|
|||
if relFilePath != "." { | |||
relFilePath = strings.Join([]string{".", relFilePath}, string(filepath.Separator)) | |||
buffer := bytes.NewBufferString(".") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better? filepath.Join
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really (for readibility you are 💯)
❯ go test -benchmem -run=^$ -bench . bench_test.go | prettybench
goos: linux
goarch: amd64
cpu: AMD Ryzen 9 5900X 12-Core Processor
PASS
benchmark iter time/iter bytes alloc allocs
--------- ---- --------- ----------- ------
BenchmarkNewBufferString-24 76683656 15.20 ns/op 0 B/op 0 allocs/op
BenchmarkNewBufferStringParallel/1-24 880934428 1.38 ns/op 0 B/op 0 allocs/op
BenchmarkNewBufferStringParallel/2-24 793567332 1.53 ns/op 0 B/op 0 allocs/op
BenchmarkNewBufferStringParallel/4-24 826919538 1.50 ns/op 0 B/op 0 allocs/op
BenchmarkNewBufferStringParallel/8-24 809302243 1.46 ns/op 0 B/op 0 allocs/op
BenchmarkFilePathJoin-24 13993242 83.81 ns/op 40 B/op 3 allocs/op
BenchmarkFilePathJoinParallel/1-24 94575600 13.63 ns/op 40 B/op 3 allocs/op
BenchmarkFilePathJoinParallel/2-24 72334652 14.96 ns/op 40 B/op 3 allocs/op
BenchmarkFilePathJoinParallel/4-24 80168283 15.62 ns/op 40 B/op 3 allocs/op
BenchmarkFilePathJoinParallel/8-24 71974920 15.55 ns/op 40 B/op 3 allocs/op
ok command-line-arguments 12.709s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, that's surprising. Thank's for the benchmark 🚀
/lgtm |
LGTM label has been added. Git tree hash: 70f8080ff29c25d9098ebf20ed561d9d95a1ef05
|
/approve no-issue |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: csweichel Associated issue requirement bypassed by: csweichel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.