-
Notifications
You must be signed in to change notification settings - Fork 18.7k
archive/tar: optimize nanosecond parsing in parsePAXTime #73164
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
Conversation
|
This PR (HEAD: 2052dcb) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/662835. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from 黄志文: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from 黄志文: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from 黄志文: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
This PR (HEAD: 280414c) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/662835. Important tips:
|
|
Message from Gopher Robot: Patch Set 2: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Joseph Tsai: Patch Set 3: (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Joseph Tsai: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
280414c to
98a382b
Compare
|
This PR (HEAD: 98a382b) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/662835. Important tips:
|
|
Message from 黄志文: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from 黄志文: Patch Set 4: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Joseph Tsai: Patch Set 4: Code-Review+1 (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from 黄志文: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
This PR (HEAD: b4dfedb) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/662835. Important tips:
|
|
Message from 黄志文: Patch Set 5: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Joseph Tsai: Patch Set 5: Code-Review+2 Commit-Queue+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Go LUCI: Patch Set 5: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2025-09-06T01:38:07Z","revision":"6b21628f3b776d2a2503e4814df76b8fafca1c26"} Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from 黄志文: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Joseph Tsai: Patch Set 5: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Go LUCI: Patch Set 5: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Go LUCI: Patch Set 5: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Dmitri Shuralyov: Patch Set 5: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Michael Pratt: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
This PR (HEAD: 106d25e) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/662835. Important tips:
|
|
Message from 黄志文: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Michael Pratt: Patch Set 6: Auto-Submit+1 Code-Review+2 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Dmitri Shuralyov: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Dmitri Shuralyov: Patch Set 6: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Dmitri Shuralyov: Patch Set 6: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
|
Message from Go LUCI: Patch Set 6: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2025-09-08T16:48:33Z","revision":"4ca116945b67136c0afadcd57cd290e4a7628a6d"} Please don’t reply on this GitHub thread. Visit golang.org/cl/662835. |
Modified parsePAXTime to use a byte array for nanosecond parsing, providing a more straightforward implementation with better performance when handling decimal fraction part.
Here are benchmark results:
goos: darwin
goarch: amd64
pkg: archive/tar
cpu: Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
ParsePAXTIme/NoNanos-8 20.55n ± 4% 20.45n ± 12% ~ (p=1.000 n=10)
ParsePAXTIme/ExactNanos-8 52.42n ± 2% 42.16n ± 3% -19.57% (p=0.000 n=10)
ParsePAXTIme/WithNanoPadding-8 99.33n ± 2% 39.58n ± 2% -60.16% (p=0.000 n=10)
ParsePAXTIme/WithNanoTruncate-8 54.78n ± 1% 43.64n ± 4% -20.34% (p=0.000 n=10)
ParsePAXTIme/TrailingError-8 31.87n ± 4% 17.55n ± 2% -44.94% (p=0.000 n=10)
ParsePAXTIme/LeadingError-8 31.03n ± 2% 15.81n ± 6% -49.03% (p=0.000 n=10)
Change-Id: If05ef512137d0115db9cb6d3ab432335230628bb
GitHub-Last-Rev: 106d25e
GitHub-Pull-Request: #73164
Reviewed-on: https://go-review.googlesource.com/c/go/+/662835
Auto-Submit: Michael Pratt <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Michael Pratt <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
|
This PR is being closed because golang.org/cl/662835 has been merged. |
Modified parsePAXTime to use a byte array for nanosecond parsing, providing a more straightforward implementation with better performance when handling decimal fraction part.
Here are benchmark results:
goos: darwin
goarch: amd64
pkg: archive/tar
cpu: Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
ParsePAXTIme/NoNanos-8 20.55n ± 4% 20.45n ± 12% ~ (p=1.000 n=10)
ParsePAXTIme/ExactNanos-8 52.42n ± 2% 42.16n ± 3% -19.57% (p=0.000 n=10)
ParsePAXTIme/WithNanoPadding-8 99.33n ± 2% 39.58n ± 2% -60.16% (p=0.000 n=10)
ParsePAXTIme/WithNanoTruncate-8 54.78n ± 1% 43.64n ± 4% -20.34% (p=0.000 n=10)
ParsePAXTIme/TrailingError-8 31.87n ± 4% 17.55n ± 2% -44.94% (p=0.000 n=10)
ParsePAXTIme/LeadingError-8 31.03n ± 2% 15.81n ± 6% -49.03% (p=0.000 n=10)