go icon indicating copy to clipboard operation
go copied to clipboard

go/token: replace map with array for looking up keywords

Open soypat opened this issue 1 month ago • 36 comments

array access has considerable less overhead than map access thus yielding benefits in performance and package initialization cost.

goos: linux goarch: amd64 pkg: cmd/compile/internal/syntax cpu: 12th Gen Intel(R) Core(TM) i5-12400F │ map.rej │ syntax.rej │ │ sec/op │ sec/op vs base │ ParseStdLib/longest_10_files-12 101.21m ± 3% 97.20m ± 2% -3.96% (p=0.000 n=20) ParseStdLib/shortest_10_files-12 14.42µ ± 2% 13.39µ ± 1% -7.14% (p=0.000 n=20) geomean 1.208m 1.141m -5.56%

soypat avatar Nov 28 '25 21:11 soypat

This PR (HEAD: 6e80fe26411d464ad28215ceee2b8d26d787fe37) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/725320.

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 avatar Nov 28 '25 21:11 gopherbot

Message from Gopher Robot:

Patch Set 1:

(1 comment)


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

gopherbot avatar Nov 28 '25 22:11 gopherbot

Message from Patricio Whittingslow:

Patch Set 1:

(1 comment)


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

gopherbot avatar Nov 28 '25 22:11 gopherbot

Message from Patricio Whittingslow:

Patch Set 1:

(1 comment)


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

gopherbot avatar Nov 28 '25 22:11 gopherbot

Message from Jorropo:

Patch Set 2: Commit-Queue+1


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

gopherbot avatar Nov 29 '25 23:11 gopherbot

Message from Go LUCI:

Patch Set 2:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2025-11-29T23:06:25Z","revision":"6e27e7d0aa01c7ac0833fbb205c40367075e7eb4"}


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

gopherbot avatar Nov 29 '25 23:11 gopherbot

Message from Jorropo:

Patch Set 2: -Commit-Queue


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

gopherbot avatar Nov 29 '25 23:11 gopherbot

Message from Go LUCI:

Patch Set 2:

This CL has passed the run


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

gopherbot avatar Nov 29 '25 23:11 gopherbot

Message from Go LUCI:

Patch Set 2: LUCI-TryBot-Result+1


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

gopherbot avatar Nov 29 '25 23:11 gopherbot

Message from Ingo Oeser:

Patch Set 2:

(1 comment)


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

gopherbot avatar Nov 30 '25 01:11 gopherbot

Message from Vann Te:

Patch Set 2:

(1 comment)


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

gopherbot avatar Nov 30 '25 11:11 gopherbot

This PR (HEAD: 087361512fa461419406e44ab82bd94f26b1817f) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/725320.

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 avatar Nov 30 '25 21:11 gopherbot

Message from Patricio Whittingslow:

Patch Set 2:

(1 comment)


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

gopherbot avatar Nov 30 '25 21:11 gopherbot

Message from Robert Griesemer:

Patch Set 3: Hold+1

(1 comment)


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

gopherbot avatar Dec 01 '25 16:12 gopherbot

Message from Patricio Whittingslow:

Patch Set 3:

(1 comment)


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

gopherbot avatar Dec 02 '25 15:12 gopherbot

Message from Patricio Whittingslow:

Patch Set 3:

(1 comment)


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

gopherbot avatar Dec 02 '25 15:12 gopherbot

Message from Robert Griesemer:

Patch Set 3:

(1 comment)


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

gopherbot avatar Dec 02 '25 23:12 gopherbot

This PR (HEAD: dbbeccc0ed76e2f0eda8c1272ce8e1fdafe68f48) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/725320.

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 avatar Dec 03 '25 15:12 gopherbot

Message from Patricio Whittingslow:

Patch Set 3:

(1 comment)


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

gopherbot avatar Dec 03 '25 15:12 gopherbot

Message from t hepudds:

Patch Set 4:

(1 comment)


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

gopherbot avatar Dec 03 '25 16:12 gopherbot

Message from Patricio Whittingslow:

Patch Set 4:

(1 comment)


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

gopherbot avatar Dec 03 '25 17:12 gopherbot

Message from Patricio Whittingslow:

Patch Set 4:

(1 comment)


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

gopherbot avatar Dec 03 '25 17:12 gopherbot

This PR (HEAD: 64baebd035b55c272cdd99e5ed069dd51f0b94d6) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/725320.

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 avatar Dec 03 '25 17:12 gopherbot

Message from t hepudds:

Patch Set 5:

(3 comments)


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

gopherbot avatar Dec 03 '25 19:12 gopherbot

Message from t hepudds:

Patch Set 5: Commit-Queue+1


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

gopherbot avatar Dec 03 '25 20:12 gopherbot

Message from Go LUCI:

Patch Set 5:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2025-12-03T20:16:45Z","revision":"a0f5f06c09970e5ce603298699d8249d6e2f088b"}


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

gopherbot avatar Dec 03 '25 20:12 gopherbot

Message from t hepudds:

Patch Set 5: -Commit-Queue


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

gopherbot avatar Dec 03 '25 20:12 gopherbot

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

gopherbot avatar Dec 03 '25 20:12 gopherbot

Message from Go LUCI:

Patch Set 5: LUCI-TryBot-Result+1


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

gopherbot avatar Dec 03 '25 20:12 gopherbot

Message from Patricio Whittingslow:

Patch Set 5:

(5 comments)


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

gopherbot avatar Dec 05 '25 12:12 gopherbot