Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: GlobMatcher uses now reflex::Matcher regex engine #4528

Merged
merged 1 commit into from
Feb 5, 2025
Merged

Conversation

romange
Copy link
Collaborator

@romange romange commented Jan 29, 2025

Also consolidate benchmarking low level routines undeer dfly_core_test

    BM_MatchGlob/1000                   121 ns          121 ns     23701780
    BM_MatchGlob/10000                  512 ns          512 ns      5481405
    BM_MatchFindSubstr/1000             123 ns          123 ns     31114255
    BM_MatchFindSubstr/10000           1126 ns         1126 ns      2522019
    BM_MatchReflexFind/1000             118 ns          118 ns     22442417
    BM_MatchReflexFind/10000            512 ns          512 ns      5414329
    BM_MatchReflexFindStar/1000         106 ns          106 ns     26276727
    BM_MatchReflexFindStar/10000        717 ns          717 ns      3719605
    BM_MatchStd/1000                  19782 ns        19779 ns       128020
    BM_MatchStd/10000                199809 ns       199781 ns        13837
    BM_MatchRedisGlob/1000             1601 ns         1601 ns      1754635
    BM_MatchRedisGlob/10000           16494 ns        16493 ns       171585
    BM_MatchRe2/1000                   1039 ns         1039 ns      2709486
    BM_MatchRe2/10000                 10041 ns        10040 ns       281296

What's curious is that now matching *foobar* on string is faster than
searching for 'foobar` using string::find() (BM_MatchGlob vs BM_MatchFindSubstr)

Improvement vs Redis is 10-30 times faster (BM_MatchRedisGlob vs BM_MatchGlob).

Signed-off-by: Roman Gershman [email protected]

@romange romange force-pushed the Pr3 branch 21 times, most recently from c90c149 to f29bdc1 Compare February 4, 2025 18:11
@romange romange requested a review from BorysTheDev February 4, 2025 18:14
Also consolidate benchmarking low level routines undeer dfly_core_test

```
BM_ParseFastFloat                   707 ns          707 ns      4005656
BM_ParseDoubleAbsl                 1460 ns         1460 ns      1927158
BM_MatchGlob/1000                   121 ns          121 ns     23701780
BM_MatchGlob/10000                  512 ns          512 ns      5481405
BM_MatchFindSubstr/1000             123 ns          123 ns     31114255
BM_MatchFindSubstr/10000           1126 ns         1126 ns      2522019
BM_MatchReflexFind/1000             118 ns          118 ns     22442417
BM_MatchReflexFind/10000            512 ns          512 ns      5414329
BM_MatchReflexFindStar/1000         106 ns          106 ns     26276727
BM_MatchReflexFindStar/10000        717 ns          717 ns      3719605
BM_MatchStd/1000                  19782 ns        19779 ns       128020
BM_MatchStd/10000                199809 ns       199781 ns        13837
BM_MatchRedisGlob/1000             1601 ns         1601 ns      1754635
BM_MatchRedisGlob/10000           16494 ns        16493 ns       171585
BM_MatchRe2/1000                   1039 ns         1039 ns      2709486
BM_MatchRe2/10000                 10041 ns        10040 ns       281296
```

What's curious is that now matching `*foobar*` on string is faster than
searching for 'foobar` using string::find() (BM_MatchGlob vs BM_MatchFindSubstr)

Improvement vs Redis is 10-30 times faster (BM_MatchRedisGlob vs BM_MatchGlob).

Signed-off-by: Roman Gershman <[email protected]>
@romange
Copy link
Collaborator Author

romange commented Feb 5, 2025

std::regex is a garbage 🤷🏼

@romange romange merged commit 6d1c22b into main Feb 5, 2025
10 checks passed
@romange romange deleted the Pr3 branch February 5, 2025 08:29
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.

2 participants