-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
base: master
Are you sure you want to change the base?
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. |
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 │
ParsePAXTimeNoTruncatePad-8 51.25n ± 1% 53.87n ± 7% ~ (p=0.075 n=10)
ParsePAXTimeRightTruncate-8 52.70n ± 1% 52.65n ± 6% ~ (p=0.912 n=10)
ParsePAXTimeRightPad-8 96.55n ± 4% 49.43n ± 11% -48.80% (p=0.000 n=10)
ParsePAXTimeError-8 31.34n ± 2% 19.52n ± 7% -37.71% (p=0.000 n=10)
ParsePAXTimeError1-8 28.46n ± 2% 16.75n ± 3% -41.17% (p=0.000 n=10)
geomean 47.13n 34.06n -27.74%