Commit fcf8d2a
[regexp] Improvements to Unicode case independent.
Case-desugar the regexp later for better performance.
We used to expand into case variants at a very early
stage, in the parser. This has two disadvantages.
Firstly, it means we do all the case work even when
just checking the syntax of a regexp, which happens
multiple places in order to give early errors.
Secondly, it disables some of the optimizations that
Irregexp can do, because now instead of literal strings
we have sequences of character classes, which are not
treated in the same way.
For character classes we have to desugar early to get
the specified semantics, but for literal texts outside
of character classes we can mostly go back to the old
behaviour that is used without the /u and /v flags.
The exception is for surrogate pairs (code points
above 0x10000) where we still desugar early. Luckily
there are no alpha letters below 0x10000 that have
case equivalents above 0x10000.
Running https://gist.github.com/erikcorry/dd5b08dd5abdf4f592628dd08db17701 I get the following output:
Before:
With 7000 terms, took 1674ms, 253ms, 28ms, 26.857142857142858ms per iteration
After:
With 7000 terms, took 332ms, 145ms, 0ms, 0ms per iteration
Bug: 40261789
Change-Id: I16dca4830c3145f436f537c1db1a0de6def9045c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5643119
Reviewed-by: Patrick Thier <[email protected]>
Commit-Queue: Erik Corry <[email protected]>
Reviewed-by: Toon Verwaest <[email protected]>
Cr-Commit-Position: refs/heads/main@{#94770}1 parent 5ad5602 commit fcf8d2a
File tree
7 files changed
+145
-93
lines changed- src
- regexp
- strings
- test
- cctest
- mjsunit/es6
7 files changed
+145
-93
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
424 | 423 | | |
425 | 424 | | |
426 | 425 | | |
| 426 | + | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| |||
1450 | 1450 | | |
1451 | 1451 | | |
1452 | 1452 | | |
| 1453 | + | |
1453 | 1454 | | |
1454 | 1455 | | |
1455 | 1456 | | |
| |||
1465 | 1466 | | |
1466 | 1467 | | |
1467 | 1468 | | |
1468 | | - | |
1469 | | - | |
| 1469 | + | |
| 1470 | + | |
1470 | 1471 | | |
1471 | 1472 | | |
1472 | 1473 | | |
| |||
1508 | 1509 | | |
1509 | 1510 | | |
1510 | 1511 | | |
1511 | | - | |
1512 | | - | |
| 1512 | + | |
| 1513 | + | |
1513 | 1514 | | |
1514 | 1515 | | |
1515 | 1516 | | |
| |||
0 commit comments