Skip to content

Add a basic ECMA-262 check helper#2407

Merged
jviotti merged 3 commits into
mainfrom
is-regex
May 25, 2026
Merged

Add a basic ECMA-262 check helper#2407
jviotti merged 3 commits into
mainfrom
is-regex

Conversation

@jviotti
Copy link
Copy Markdown
Member

@jviotti jviotti commented May 25, 2026

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 25, 2026

🤖 Augment PR Summary

Summary: This PR introduces a new public helper for validating ECMA-262-style regular expressions.

Changes:

  • Added sourcemeta::core::is_regex_ecma() to check whether a pattern is considered valid before use.
  • Refactored internal preprocessing into a templated preprocess_regex<CheckECMA> to support validation-related flows.
  • Tightened preprocessing to reject escape sequences that are not valid in ECMA-262 “strict mode”.
  • Implemented the new helper by preprocessing then compiling with PCRE2 using the same option set as to_regex().
  • Added a dedicated test suite (regex_is_ecma_test.cc) covering common valid/invalid patterns.
  • Updated existing ECMA-262 and RFC9485 regex tests to assert is_regex_ecma() alongside to_regex().
  • Registered the new test file in test/regex/CMakeLists.txt.

Technical Notes: Validation is currently based on the project’s preprocessing + PCRE2 compilation (Unicode + DOTALL + related flags), so the helper reflects the same regex dialect used by to_regex().

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/core/regex/include/sourcemeta/core/regex.h
Comment thread src/core/regex/regex.cc
pcre2_code *pcre2_regex_raw{pcre2_compile(
reinterpret_cast<PCRE2_SPTR>(pcre2_pattern.value().c_str()),
pcre2_pattern.value().size(),
PCRE2_UTF | PCRE2_UCP | PCRE2_NO_AUTO_CAPTURE | PCRE2_DOTALL |
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/core/regex/regex.cc:129 — is_regex_ecma() currently delegates validity to PCRE2 compilation, which can accept PCRE-specific constructs that aren’t part of ECMA-262 (e.g., inline option groups / atomic groups). If this API is intended as an ECMA-262 validator, this may lead to false positives (returning true for non-ECMA patterns).

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 7 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/core/regex/preprocess.h
Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (macos/llvm)

Details
Benchmark suite Current: 90e79a5 Previous: 6259ac8 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.9614519078778743 ns/iter 2.214708421809416 ns/iter 0.89
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.7319357236920885 ns/iter 1.8922963073527772 ns/iter 0.92
Regex_Period_Asterisk 1.6218210408339826 ns/iter 1.9268471285450535 ns/iter 0.84
Regex_Group_Period_Asterisk_Group 1.6963157071328128 ns/iter 1.8919145843947236 ns/iter 0.90
Regex_Period_Plus 2.044643105805981 ns/iter 1.8827192948741232 ns/iter 1.09
Regex_Period 2.0616243693040626 ns/iter 1.8807281112254044 ns/iter 1.10
Regex_Caret_Period_Plus_Dollar 1.975764476418891 ns/iter 1.8839158079903682 ns/iter 1.05
Regex_Caret_Group_Period_Plus_Group_Dollar 1.9484668952964637 ns/iter 1.9687539641318252 ns/iter 0.99
Regex_Caret_Period_Asterisk_Dollar 1.6417455713779525 ns/iter 1.8885451691084727 ns/iter 0.87
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.6790538060640372 ns/iter 1.8787883812852415 ns/iter 0.89
Regex_Caret_X_Hyphen 5.713377041782573 ns/iter 5.659084786082488 ns/iter 1.01
Regex_Period_Md_Dollar 16.13109473652448 ns/iter 15.616261747877711 ns/iter 1.03
Regex_Caret_Slash_Period_Asterisk 9.539988308842801 ns/iter 7.502627110794482 ns/iter 1.27
Regex_Caret_Period_Range_Dollar 1.7645719523776686 ns/iter 1.5678524292286051 ns/iter 1.13
Regex_Nested_Backtrack 27.944555349510832 ns/iter 22.708733431871988 ns/iter 1.23
JSON_Array_Of_Objects_Unique 450.594494097514 ns/iter 394.324795483227 ns/iter 1.14
JSON_Parse_1 5362.714023609308 ns/iter 3634.9548944092357 ns/iter 1.48
JSON_Parse_Real 9330.912016971959 ns/iter 5884.087877997506 ns/iter 1.59
JSON_Parse_Decimal 9674.18465246172 ns/iter 7386.045830794974 ns/iter 1.31
JSON_Parse_Schema_ISO_Language 3273466.901869174 ns/iter 3008839.7783502685 ns/iter 1.09
JSON_Fast_Hash_Helm_Chart_Lock 59.22385699531986 ns/iter 54.46975763729809 ns/iter 1.09
JSON_Equality_Helm_Chart_Lock 171.8385229725015 ns/iter 123.89773305640013 ns/iter 1.39
JSON_Divisible_By_Decimal 182.27371685185764 ns/iter 160.82709719297847 ns/iter 1.13
JSON_String_Equal/10 7.05544698312782 ns/iter 6.32713066542303 ns/iter 1.12
JSON_String_Equal/100 6.50383163693196 ns/iter 5.98290539714769 ns/iter 1.09
JSON_String_Equal_Small_By_Perfect_Hash/10 0.7700321881467818 ns/iter 0.7169631453772088 ns/iter 1.07
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.3260115466152964 ns/iter 3.0745365505029203 ns/iter 1.08
JSON_String_Fast_Hash/10 2.276626188079374 ns/iter 2.19432123757494 ns/iter 1.04
JSON_String_Fast_Hash/100 2.293648179303881 ns/iter 1.8800582457490715 ns/iter 1.22
JSON_String_Key_Hash/10 1.667520118935022 ns/iter 1.2538480581827374 ns/iter 1.33
JSON_String_Key_Hash/100 2.4116029275069932 ns/iter 1.9879569855213395 ns/iter 1.21
JSON_Object_Defines_Miss_Same_Length 2.378693896729566 ns/iter 2.273163007716403 ns/iter 1.05
JSON_Object_Defines_Miss_Too_Small 2.3733082403310743 ns/iter 2.1953303654218894 ns/iter 1.08
JSON_Object_Defines_Miss_Too_Large 2.5641445721743454 ns/iter 2.19300330156004 ns/iter 1.17
Pointer_Object_Traverse 13.96099579704487 ns/iter 13.128322818420331 ns/iter 1.06
Pointer_Object_Try_Traverse 18.137565287341953 ns/iter 17.893856470695926 ns/iter 1.01
Pointer_Push_Back_Pointer_To_Weak_Pointer 153.6311861340864 ns/iter 144.30665824888194 ns/iter 1.06
Pointer_Walker_Schema_ISO_Language 4163251.973684031 ns/iter 3518758.084577151 ns/iter 1.18
Pointer_Maybe_Tracked_Deeply_Nested/0 1089825.2843536797 ns/iter 899304.0012437722 ns/iter 1.21
Pointer_Maybe_Tracked_Deeply_Nested/1 1294888.4772726528 ns/iter 1194108.4051723636 ns/iter 1.08
Pointer_Position_Tracker_Get_Deeply_Nested 344.5617338064382 ns/iter 322.57217193593317 ns/iter 1.07
URITemplateRouter_Create 21523.346641420547 ns/iter 21065.61354895308 ns/iter 1.02
URITemplateRouter_Match 157.98750206509678 ns/iter 156.27833033876337 ns/iter 1.01
URITemplateRouter_Match_BasePath 190.39844486958427 ns/iter 183.44751222692577 ns/iter 1.04
URITemplateRouterView_Restore 9319.999301676165 ns/iter 8646.123766284814 ns/iter 1.08
URITemplateRouterView_Match 122.66278532681996 ns/iter 122.42704337733377 ns/iter 1.00
URITemplateRouterView_Match_BasePath 144.66596084292902 ns/iter 138.27113631398984 ns/iter 1.05
URITemplateRouterView_Arguments 384.76488565988126 ns/iter 383.7567771816562 ns/iter 1.00
JSONL_Parse_Large 12099379.545454461 ns/iter 11210779.564516045 ns/iter 1.08
JSONL_Parse_Large_GZIP 12296146.226415934 ns/iter 11865607.338981815 ns/iter 1.04
HTML_Build_Table_100000 61992995.799994335 ns/iter 59462370.79999719 ns/iter 1.04
HTML_Render_Table_100000 3803050.9591077697 ns/iter 2234846.8636363423 ns/iter 1.70
GZIP_Compress_ISO_Language_Set_3_Locations 26872711.956521608 ns/iter 26169583.333331436 ns/iter 1.03
GZIP_Decompress_ISO_Language_Set_3_Locations 4603278.659574921 ns/iter 4712118.927151752 ns/iter 0.98
GZIP_Compress_ISO_Language_Set_3_Schema 1493881.889112871 ns/iter 1439757.442265779 ns/iter 1.04
GZIP_Decompress_ISO_Language_Set_3_Schema 277324.07407409936 ns/iter 261537.44064615114 ns/iter 1.06

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/llvm)

Details
Benchmark suite Current: 90e79a5 Previous: 6259ac8 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.191344905824453 ns/iter 2.461711352964821 ns/iter 0.89
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.195560807634575 ns/iter 2.462499234444087 ns/iter 0.89
Regex_Period_Asterisk 2.1936270742595845 ns/iter 2.462956177241711 ns/iter 0.89
Regex_Group_Period_Asterisk_Group 2.192841166387624 ns/iter 2.4651837970017585 ns/iter 0.89
Regex_Period_Plus 2.802493477849721 ns/iter 3.8673416276376025 ns/iter 0.72
Regex_Period 3.1122955183414502 ns/iter 4.218721202984562 ns/iter 0.74
Regex_Caret_Period_Plus_Dollar 2.8015281745977108 ns/iter 3.868066220076544 ns/iter 0.72
Regex_Caret_Group_Period_Plus_Group_Dollar 3.1137700565305453 ns/iter 4.220737995196853 ns/iter 0.74
Regex_Caret_Period_Asterisk_Dollar 3.114355112483086 ns/iter 2.4639675033182677 ns/iter 1.26
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.423453601146661 ns/iter 2.462483771833626 ns/iter 1.39
Regex_Caret_X_Hyphen 6.543075498443893 ns/iter 7.030357978549316 ns/iter 0.93
Regex_Period_Md_Dollar 27.44791168816095 ns/iter 26.642876232303422 ns/iter 1.03
Regex_Caret_Slash_Period_Asterisk 6.844458138628273 ns/iter 7.381864663486718 ns/iter 0.93
Regex_Caret_Period_Range_Dollar 3.7342334259704786 ns/iter 3.868772199292768 ns/iter 0.97
Regex_Nested_Backtrack 36.667813599081335 ns/iter 37.11006511047717 ns/iter 0.99
JSON_Array_Of_Objects_Unique 388.63153206369174 ns/iter 426.9447772006962 ns/iter 0.91
JSON_Parse_1 5983.002172327005 ns/iter 5679.814853033129 ns/iter 1.05
JSON_Parse_Real 10549.074779244931 ns/iter 10271.340704653427 ns/iter 1.03
JSON_Parse_Decimal 10919.278387708426 ns/iter 11726.280996427566 ns/iter 0.93
JSON_Parse_Schema_ISO_Language 3613730.461139887 ns/iter 3697202.4708993845 ns/iter 0.98
JSON_Fast_Hash_Helm_Chart_Lock 53.568479699725295 ns/iter 66.66323054400148 ns/iter 0.80
JSON_Equality_Helm_Chart_Lock 160.58697818047855 ns/iter 163.49209247662418 ns/iter 0.98
JSON_Divisible_By_Decimal 250.08684978191897 ns/iter 246.60716132456633 ns/iter 1.01
JSON_String_Equal/10 6.234486130754296 ns/iter 6.33527527425553 ns/iter 0.98
JSON_String_Equal/100 6.855940698589858 ns/iter 7.044726426883466 ns/iter 0.97
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9359935864166041 ns/iter 1.0546353707992873 ns/iter 0.89
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 10.274575358542267 ns/iter 12.342751810932201 ns/iter 0.83
JSON_String_Fast_Hash/10 2.4917336174176548 ns/iter 2.8149553630575017 ns/iter 0.89
JSON_String_Fast_Hash/100 2.4928533039246563 ns/iter 2.8156923868277453 ns/iter 0.89
JSON_String_Key_Hash/10 2.1842112738847086 ns/iter 2.461954983459201 ns/iter 0.89
JSON_String_Key_Hash/100 6.552295013955747 ns/iter 7.737226362842366 ns/iter 0.85
JSON_Object_Defines_Miss_Same_Length 3.7399685658557837 ns/iter 4.2213112906302515 ns/iter 0.89
JSON_Object_Defines_Miss_Too_Small 3.739566033283594 ns/iter 4.2296339620674 ns/iter 0.88
JSON_Object_Defines_Miss_Too_Large 3.743165085724141 ns/iter 4.228421936638656 ns/iter 0.89
Pointer_Object_Traverse 24.353301038423723 ns/iter 27.26489000088211 ns/iter 0.89
Pointer_Object_Try_Traverse 26.074485912949427 ns/iter 30.244900924186776 ns/iter 0.86
Pointer_Push_Back_Pointer_To_Weak_Pointer 153.55919809197974 ns/iter 175.79184153031707 ns/iter 0.87
Pointer_Walker_Schema_ISO_Language 3046757.5676855366 ns/iter 3085196.6577776894 ns/iter 0.99
Pointer_Maybe_Tracked_Deeply_Nested/0 1425737.232741553 ns/iter 1422953.665987938 ns/iter 1.00
Pointer_Maybe_Tracked_Deeply_Nested/1 2065022.48967549 ns/iter 1754236.4039901937 ns/iter 1.18
Pointer_Position_Tracker_Get_Deeply_Nested 617.702121185425 ns/iter 668.4064309270244 ns/iter 0.92
URITemplateRouter_Create 32273.292171587775 ns/iter 30685.904159051966 ns/iter 1.05
URITemplateRouter_Match 176.452614745131 ns/iter 175.27127696925953 ns/iter 1.01
URITemplateRouter_Match_BasePath 205.15050188903086 ns/iter 212.15884312390446 ns/iter 0.97
URITemplateRouterView_Restore 7723.949532893489 ns/iter 8715.408041216924 ns/iter 0.89
URITemplateRouterView_Match 144.0346610278461 ns/iter 144.87223890299373 ns/iter 0.99
URITemplateRouterView_Match_BasePath 163.39036624483697 ns/iter 169.113355485049 ns/iter 0.97
URITemplateRouterView_Arguments 440.6852811076032 ns/iter 471.95839348600214 ns/iter 0.93
JSONL_Parse_Large 11000559.156250311 ns/iter 10057422.900000086 ns/iter 1.09
JSONL_Parse_Large_GZIP 12212368.807017252 ns/iter 11486005.32258115 ns/iter 1.06
HTML_Build_Table_100000 67665765.72728024 ns/iter 83167227.1250028 ns/iter 0.81
HTML_Render_Table_100000 5422104.108526773 ns/iter 4993445.935251853 ns/iter 1.09
GZIP_Compress_ISO_Language_Set_3_Locations 33877512.57142619 ns/iter 36146031.26315711 ns/iter 0.94
GZIP_Decompress_ISO_Language_Set_3_Locations 4661707.0999999065 ns/iter 4776373.216216328 ns/iter 0.98
GZIP_Compress_ISO_Language_Set_3_Schema 1888558.25067371 ns/iter 2145224.2975459197 ns/iter 0.88
GZIP_Decompress_ISO_Language_Set_3_Schema 377466.0522347577 ns/iter 293589.1308724771 ns/iter 1.29

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/gcc)

Details
Benchmark suite Current: 90e79a5 Previous: 6259ac8 Ratio
GZIP_Compress_ISO_Language_Set_3_Locations 38589093.61111134 ns/iter 38790445.18750163 ns/iter 0.99
GZIP_Decompress_ISO_Language_Set_3_Locations 5231794.824427538 ns/iter 4924292.71942459 ns/iter 1.06
GZIP_Compress_ISO_Language_Set_3_Schema 2073484.2529761756 ns/iter 2093246.271641562 ns/iter 0.99
GZIP_Decompress_ISO_Language_Set_3_Schema 394562.9920589695 ns/iter 393512.9915635295 ns/iter 1.00
HTML_Build_Table_100000 59396501.49999902 ns/iter 58678170.24999529 ns/iter 1.01
HTML_Render_Table_100000 1813511.4677002728 ns/iter 1949870.322946275 ns/iter 0.93
JSONL_Parse_Large 12964743.351852171 ns/iter 13153314.905660512 ns/iter 0.99
JSONL_Parse_Large_GZIP 14154436.285714522 ns/iter 14227589.551020565 ns/iter 0.99
URITemplateRouter_Create 31412.326602794634 ns/iter 30494.2430292761 ns/iter 1.03
URITemplateRouter_Match 178.9027130692411 ns/iter 175.2384673235234 ns/iter 1.02
URITemplateRouter_Match_BasePath 202.36976516617955 ns/iter 198.9921090924709 ns/iter 1.02
URITemplateRouterView_Restore 7886.774478160469 ns/iter 7768.154738753642 ns/iter 1.02
URITemplateRouterView_Match 143.62369033729857 ns/iter 147.93337378319652 ns/iter 0.97
URITemplateRouterView_Match_BasePath 165.03371539222016 ns/iter 165.4127349563449 ns/iter 1.00
URITemplateRouterView_Arguments 473.7285131309556 ns/iter 475.3737998812673 ns/iter 1.00
Pointer_Object_Traverse 24.568927264984964 ns/iter 26.37604309888047 ns/iter 0.93
Pointer_Object_Try_Traverse 20.26911848489957 ns/iter 22.119406012845772 ns/iter 0.92
Pointer_Push_Back_Pointer_To_Weak_Pointer 136.38890797318786 ns/iter 149.4552309206275 ns/iter 0.91
Pointer_Walker_Schema_ISO_Language 3301907.3380281776 ns/iter 3298411.504716732 ns/iter 1.00
Pointer_Maybe_Tracked_Deeply_Nested/0 1591143.5530473678 ns/iter 1649036.5761124163 ns/iter 0.96
Pointer_Maybe_Tracked_Deeply_Nested/1 1741813.7556109868 ns/iter 1926399.7932962512 ns/iter 0.90
Pointer_Position_Tracker_Get_Deeply_Nested 552.0503196860863 ns/iter 497.95522224808354 ns/iter 1.11
JSON_Array_Of_Objects_Unique 428.32582158760476 ns/iter 424.95275550580214 ns/iter 1.01
JSON_Parse_1 8165.711753895565 ns/iter 8061.190035131865 ns/iter 1.01
JSON_Parse_Real 12173.221425706277 ns/iter 11855.739303329648 ns/iter 1.03
JSON_Parse_Decimal 17933.32176874126 ns/iter 18004.181969650053 ns/iter 1.00
JSON_Parse_Schema_ISO_Language 4762843.668918768 ns/iter 4761408.705478952 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 62.956365632689824 ns/iter 74.44218160595234 ns/iter 0.85
JSON_Equality_Helm_Chart_Lock 163.0423396338805 ns/iter 162.26888599781 ns/iter 1.00
JSON_Divisible_By_Decimal 237.55471973520991 ns/iter 234.86457704454233 ns/iter 1.01
JSON_String_Equal/10 5.964148153159204 ns/iter 6.020583383472844 ns/iter 0.99
JSON_String_Equal/100 6.641249904372637 ns/iter 6.626024931480394 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 0.7401095665662291 ns/iter 0.6253647730352104 ns/iter 1.18
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 25.198368508914875 ns/iter 25.195037877016023 ns/iter 1.00
JSON_String_Fast_Hash/10 0.9343589436600458 ns/iter 0.9344317551017735 ns/iter 1.00
JSON_String_Fast_Hash/100 0.9351576254124165 ns/iter 0.934699379842692 ns/iter 1.00
JSON_String_Key_Hash/10 1.2483936315124822 ns/iter 1.5584401281336433 ns/iter 0.80
JSON_String_Key_Hash/100 12.598245248238282 ns/iter 12.446598081474422 ns/iter 1.01
JSON_Object_Defines_Miss_Same_Length 3.126045811938657 ns/iter 3.4238385412968193 ns/iter 0.91
JSON_Object_Defines_Miss_Too_Small 3.1140749848126545 ns/iter 3.737910838404643 ns/iter 0.83
JSON_Object_Defines_Miss_Too_Large 3.4245486356589674 ns/iter 3.114664155702811 ns/iter 1.10
Regex_Lower_S_Or_Upper_S_Asterisk 0.9351073705274769 ns/iter 0.9345355563671791 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 0.6237849282600434 ns/iter 0.9343042850963842 ns/iter 0.67
Regex_Period_Asterisk 0.6238089775943513 ns/iter 0.6251642528068284 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 0.9345811918250314 ns/iter 0.6254405728376613 ns/iter 1.49
Regex_Period_Plus 0.934789364454822 ns/iter 0.9342567017859221 ns/iter 1.00
Regex_Period 0.6227076928518036 ns/iter 0.9348401562764769 ns/iter 0.67
Regex_Caret_Period_Plus_Dollar 0.6230031295586661 ns/iter 0.6227333551040445 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 0.9345616546560436 ns/iter 0.6228772162298529 ns/iter 1.50
Regex_Caret_Period_Asterisk_Dollar 0.9349091160900068 ns/iter 0.9357967966395021 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 0.6248314950800011 ns/iter 0.9338680941606564 ns/iter 0.67
Regex_Caret_X_Hyphen 4.047827326017107 ns/iter 4.3764547012111645 ns/iter 0.92
Regex_Period_Md_Dollar 37.46314409203407 ns/iter 31.27427213537653 ns/iter 1.20
Regex_Caret_Slash_Period_Asterisk 4.36285110258342 ns/iter 4.360450202286157 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 0.7785280758763407 ns/iter 0.9372589016897391 ns/iter 0.83
Regex_Nested_Backtrack 43.37255559226382 ns/iter 44.707285818335905 ns/iter 0.97

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (windows/msvc)

Details
Benchmark suite Current: 90e79a5 Previous: 6259ac8 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 7.560175223213506 ns/iter 9.814351295471903 ns/iter 0.77
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 7.503248883927885 ns/iter 8.737131657422928 ns/iter 0.86
Regex_Period_Asterisk 7.506290178571311 ns/iter 9.026406249999905 ns/iter 0.83
Regex_Group_Period_Asterisk_Group 7.515822544643669 ns/iter 8.591886122358348 ns/iter 0.87
Regex_Period_Plus 9.677510937500244 ns/iter 9.02125174544173 ns/iter 1.07
Regex_Period 9.679036563932945 ns/iter 10.18249531249893 ns/iter 0.95
Regex_Caret_Period_Plus_Dollar 9.683500403198272 ns/iter 9.254734780111608 ns/iter 1.05
Regex_Caret_Group_Period_Plus_Group_Dollar 9.69200084959012 ns/iter 10.199690579465972 ns/iter 0.95
Regex_Caret_Period_Asterisk_Dollar 7.508641741071591 ns/iter 10.182964062501298 ns/iter 0.74
Regex_Caret_Group_Period_Asterisk_Group_Dollar 7.521181919643333 ns/iter 9.128969866071099 ns/iter 0.82
Regex_Caret_X_Hyphen 11.606800000000916 ns/iter 11.077243749999965 ns/iter 1.05
Regex_Period_Md_Dollar 38.04690290178619 ns/iter 40.63955357143101 ns/iter 0.94
Regex_Caret_Slash_Period_Asterisk 11.389873437499531 ns/iter 11.335371874999112 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 9.679052635362012 ns/iter 8.871084821429065 ns/iter 1.09
Regex_Nested_Backtrack 46.402083960695606 ns/iter 62.835825892853286 ns/iter 0.74
JSON_Array_Of_Objects_Unique 481.6108378235678 ns/iter 641.6522074010331 ns/iter 0.75
JSON_Parse_1 8301.061383929768 ns/iter 13478.474426454488 ns/iter 0.62
JSON_Parse_Real 15209.10267857088 ns/iter 16106.126157094717 ns/iter 0.94
JSON_Parse_Decimal 15584.968750001086 ns/iter 16234.035714285863 ns/iter 0.96
JSON_Parse_Schema_ISO_Language 6281308.928572165 ns/iter 8097446.666667263 ns/iter 0.78
JSON_Fast_Hash_Helm_Chart_Lock 71.00129464285081 ns/iter 53.301136696646196 ns/iter 1.33
JSON_Equality_Helm_Chart_Lock 264.1963287587653 ns/iter 262.40507310694926 ns/iter 1.01
JSON_Divisible_By_Decimal 248.0929642857177 ns/iter 300.52367847788366 ns/iter 0.83
JSON_String_Equal/10 12.88559107142768 ns/iter 11.979921874999633 ns/iter 1.08
JSON_String_Equal/100 13.220740789194572 ns/iter 16.72827198619477 ns/iter 0.79
JSON_String_Equal_Small_By_Perfect_Hash/10 1.8838122338250265 ns/iter 1.7868176574466548 ns/iter 1.05
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 12.914387500001924 ns/iter 10.912203124998854 ns/iter 1.18
JSON_String_Fast_Hash/10 3.781443743247757 ns/iter 2.226393234619214 ns/iter 1.70
JSON_String_Fast_Hash/100 3.7710276280361916 ns/iter 2.6683384375001395 ns/iter 1.41
JSON_String_Key_Hash/10 3.8058069136957573 ns/iter 3.178055510555417 ns/iter 1.20
JSON_String_Key_Hash/100 14.410741676738517 ns/iter 14.500995535714015 ns/iter 0.99
JSON_Object_Defines_Miss_Same_Length 3.768065350414114 ns/iter 4.058507254464899 ns/iter 0.93
JSON_Object_Defines_Miss_Too_Small 3.765964278989484 ns/iter 4.539340859389969 ns/iter 0.83
JSON_Object_Defines_Miss_Too_Large 5.552534999999352 ns/iter 5.041579464285104 ns/iter 1.10
Pointer_Object_Traverse 41.27534689637723 ns/iter 43.49048787841192 ns/iter 0.95
Pointer_Object_Try_Traverse 52.65557000000172 ns/iter 58.56192999999621 ns/iter 0.90
Pointer_Push_Back_Pointer_To_Weak_Pointer 151.9207142857074 ns/iter 195.3027926203962 ns/iter 0.78
Pointer_Walker_Schema_ISO_Language 12981208.000001062 ns/iter 15691300.000000866 ns/iter 0.83
Pointer_Maybe_Tracked_Deeply_Nested/0 2041171.428571228 ns/iter 2588537.7510041185 ns/iter 0.79
Pointer_Maybe_Tracked_Deeply_Nested/1 3271580.35714297 ns/iter 5133856.375839163 ns/iter 0.64
Pointer_Position_Tracker_Get_Deeply_Nested 611.1336035898096 ns/iter 1020.701283726731 ns/iter 0.60
URITemplateRouter_Create 41221.98363414608 ns/iter 45510.12705531053 ns/iter 0.91
URITemplateRouter_Match 207.0695937499778 ns/iter 242.42089285710986 ns/iter 0.85
URITemplateRouter_Match_BasePath 240.41327673961598 ns/iter 280.5336839047642 ns/iter 0.86
URITemplateRouterView_Restore 32978.59821428415 ns/iter 24774.974999999697 ns/iter 1.33
URITemplateRouterView_Match 158.8746875000118 ns/iter 160.50136160712063 ns/iter 0.99
URITemplateRouterView_Match_BasePath 181.7044983664641 ns/iter 185.7966419060315 ns/iter 0.98
URITemplateRouterView_Arguments 448.64368749998107 ns/iter 425.302861096449 ns/iter 1.05
JSONL_Parse_Large 31112786.363631915 ns/iter 30898627.27272868 ns/iter 1.01
JSONL_Parse_Large_GZIP 30800572.72727159 ns/iter 29602745.83333463 ns/iter 1.04
HTML_Build_Table_100000 88533585.71427958 ns/iter 101435842.85713457 ns/iter 0.87
HTML_Render_Table_100000 8449907.777777651 ns/iter 14420998.000000509 ns/iter 0.59
GZIP_Compress_ISO_Language_Set_3_Locations 41954647.05882092 ns/iter 43477199.999999054 ns/iter 0.96
GZIP_Decompress_ISO_Language_Set_3_Locations 11202914.062499402 ns/iter 17024595.12195241 ns/iter 0.66
GZIP_Compress_ISO_Language_Set_3_Schema 2329888.963210584 ns/iter 2438998.6622072747 ns/iter 0.96
GZIP_Decompress_ISO_Language_Set_3_Schema 675005.4464286036 ns/iter 745845.2008928569 ns/iter 0.91

This comment was automatically generated by workflow using github-action-benchmark.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/core/regex/preprocess.h Outdated
Comment thread src/core/regex/preprocess.h Outdated
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti merged commit e832723 into main May 25, 2026
13 checks passed
@jviotti jviotti deleted the is-regex branch May 25, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant