Closed cesco69 closed 6 months ago
Side node, also merged into the "origin" project of the regex https://github.com/BridgeAR/fast-json-escape/pull/6
@mcollina this PR is a good perfrmance improvent (the other I have made are just micro-optimization), please, I need some attention here.
What attention do you need?
What attention do you need?
@mcollina Because it seem a good improvement on long string parsing (from 2.2% to 5.8), I would like to get this PR into the master's as quickly as possible.
The regex
can be
The first part of alternation (
[\u0000-\u001f\u0022\u005c\ud800-\udfff]
) will match anything that might have been matched by the second ([\ud800-\udbff](?![\udc00-\udfff])
) and third part ((?:[^\ud800-\udbff]|^)[\udc00-\udfff]
).I have made this simple online test for play with both rule (https://jsfiddle.net/nd84e7fz/):
output
The two rule works in the same manner!
benchmark only regex execution
benchmark fast-json-stringify (
npm run bench
) with focus on long string masterPR
DIFF
Checklist
npm run test
andnpm run benchmark