Skip to content

Conversation

@1911860538
Copy link

@1911860538 1911860538 commented Apr 4, 2025

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)

@gopherbot
Copy link
Contributor

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:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from 黄志文:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from 黄志文:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from 黄志文:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 2:

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
A maintainer will review your change and provide feedback. See
https://go.dev/doc/contribute#review for more info and tips to get your
patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11 or adds a tag like "wait-release", it means that this CL will be
reviewed as part of the next development cycle. See https://go.dev/s/release
for more details.


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Joseph Tsai:

Patch Set 3:

(4 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Joseph Tsai:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from 黄志文:

Patch Set 4:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from 黄志文:

Patch Set 4:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from 黄志文:

Patch Set 4:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from 黄志文:

Patch Set 5:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from 黄志文:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Joseph Tsai:

Patch Set 5: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 5: LUCI-TryBot-Result+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 5: Code-Review+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Michael Pratt:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from 黄志文:

Patch Set 6:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 6:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 6: Code-Review+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 6: Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/662835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Sep 8, 2025
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]>
@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/662835 has been merged.

@gopherbot gopherbot closed this Sep 8, 2025
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