Closed Bug 2081471 Opened 1 month ago Closed 1 month ago

Use the ASCII-specific identifier-part predicate in TokenStreamSpecific::identifierName for the hot ASCII identifier-continuation scanning path.

Categories

(Core :: Performance: Automated Findings, defect)

defect

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: perf-ai-bot, Assigned: iain)

References

(Blocks 1 open bug)

Details

(Whiteboard: [foofrix:12e8729b-dd59-4b0f-829e-8607d0bfcf67])

Attachments

(1 external file, 1 obsolete file)

Use the ASCII-specific identifier-part predicate in TokenStreamSpecific::identifierName for the hot ASCII identifier-continuation scanning path.

Problem

TokenStreamSpecific::identifierName calls the generic char16_t IsIdentifierPart helper for each ASCII identifier continuation code unit after the first character, adding an avoidable ASCII-range branch in the hot TipTap module parsing path.

Performance

  • Benchmark: speedometer3
  • Component: JS
  • Local Improvement: 1.94%

Validation

Blocks: speedometer3

Please move this bug to the correct component.

Once the Phabricator patch is ready for review, please commandeer it.

Flags: needinfo?(iireland)

Use the ASCII-specific identifier-part predicate in TokenStreamSpecific::identifierName for the hot ASCII identifier-continuation scanning path.

Attachment #9658809 - Attachment is obsolete: true
Flags: needinfo?(iireland)

Foofrix wrote this patch to avoid the if (ch < 128) branch in IsIdentifierPart. It seems like LLVM should be able to do this itself, but this does make my local build 1% faster in multi-inspector-code-load (which does a lot of parsing). It's plausible that PGO covers this, but this patch can't hurt.

Assignee: nobody → iireland
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by iireland@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/285da9c02776 https://hg.mozilla.org/integration/autoland/rev/f7b8e664fece Use IsIdentifierStartASCII when we know the character is ASCII r=spidermonkey-reviewers,mgaudet
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
QA Whiteboard: [qa-triage-done-c161/b160]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: