Repository navigation
Conversation
|
I mean it looks like a rather harmless optimization. But isnt the parser only called very few times (or even only once?) for a script? |
|
Thanks. Yes, the parser runs once. The numbers are for parsing only, not for running the script. |
Ahh makes sense sorry. completely ignored the headers of the table XD |
abdulhamid999
left a comment
There was a problem hiding this comment.
Nice optimization! The ASCII fast path matches ECMAScript §12.7 nicely since \UnicodeIDStart\ in ASCII is strictly [A-Za-z]\ and \UnicodeIDContinue\ in ASCII is strictly [0-9A-Za-z_].
One tiny detail in \is_identifier_part: since \ch < 0x80\ returns early, \
|
One tiny detail in |
|
@abdulhamid999 Thanks. Done in 10c2bd9. |
|
Looks great! The fallback is much cleaner now without the unreachable checks. Thanks for the quick update! |
It changes the following:
ID_Start/ID_Continuesets for every character. Now ASCII characters use a direct check. The tokens do not change.Parser::parse_scriptrichards.jsdeltablue.jscrypto.jsNo benchmark was slower. I used 16 interleaved rounds of criterion (Apple M5, rustc 1.98.0).
Old and new ASTs matched on 1M random scripts.