Dimchikkk opened a new pull request, #13364:
URL: https://github.com/apache/datafusion/pull/13364

   ## Which issue does this PR close?
   
   Closes #13011
   
   ## Rationale for this change
   
   regexp_count becomes as performant as other regexp functions
   
   ## What changes are included in this PR?
   
   Cache on pattern & use get/insert instead of entry API. 
   
   I was checking against regexp_replace functionality: one difference were 
that cache key in regexp_replace functionality was pattern and not raw regex 
string but it didn't make much difference in benchmarks, what made the 
difference to my surprise is using get/insert HashMap API instead of entry.
   
   ## Are these changes tested?
   
   ```rs
       Finished `bench` profile [optimized] target(s) in 0.59s
        Running benches/regx.rs (target/release/deps/regx-47e5923f6186ee59)
   regexp_count_1000 string
                           time:   [2.4637 ms 2.4736 ms 2.4846 ms]
                           change: [-2.1467% -1.5864% -1.0745%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 4 outliers among 100 measurements (4.00%)
     3 (3.00%) high mild
     1 (1.00%) high severe
   
   regexp_count_1000 utf8view
                           time:   [2.4603 ms 2.4695 ms 2.4796 ms]
                           change: [-1.9445% -1.4216% -0.8913%] (p = 0.00 < 
0.05)
                           Change within noise threshold.
   Found 4 outliers among 100 measurements (4.00%)
     1 (1.00%) high mild
     3 (3.00%) high severe
   
   regexp_like_1000        time:   [2.4182 ms 2.4276 ms 2.4379 ms]
                           change: [-3.0321% -2.4573% -1.8733%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 9 outliers among 100 measurements (9.00%)
     8 (8.00%) high mild
     1 (1.00%) high severe
   
   regexp_match_1000       time:   [2.8156 ms 2.8225 ms 2.8300 ms]
                           change: [-3.2103% -2.6044% -2.0384%] (p = 0.00 < 
0.05)
                           Performance has improved.
   Found 6 outliers among 100 measurements (6.00%)
     6 (6.00%) high mild
   
   regexp_replace_1000     time:   [2.2435 ms 2.2507 ms 2.2594 ms]
                           change: [-0.2583% +0.1978% +0.6765%] (p = 0.42 > 
0.05)
                           No change in performance detected.
   Found 3 outliers among 100 measurements (3.00%)
     2 (2.00%) high mild
     1 (1.00%) high severe
   ```
   
   ## Are there any user-facing changes?
   
   No
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to