Skip to content

Commit 063c8f2

Browse files
committed
Added search speed table
1 parent b873883 commit 063c8f2

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ Examples: `->dot("zeroOrMore")` `->exact("hello worls", false, "1+")`
4242
- cardType: Restrict to specific card types (e.g., Visa, MasterCard). ✔️
4343
- onlyAlphanumeric: Restrict to alphanumeric characters only. ✔️
4444
- SpecificTags (HtmlTagPattern): To allow or restrict specific HTML tags.✔️
45-
- RegexFlags: To allow users to set global regex flags (like case-insensitivity, multiline, etc.). ✔️ (Added not as option, but in Builder and basePattern)
45+
- RegexFlags: To allow users to set global regex flags (like case-insensitivity, multiline, etc.). ✔️ (_Added not as option, but in Builder and basePattern_)
4646
- usernameLength: Set minimum and maximum length for the username part of the email.
4747
- dateFormat, timeFormat: Specify the format of date and time (e.g., MM-DD-YYYY, HH:MM).
48-
- Consider to register Patterns like options using key (name) => value (class) pairs (check performance)
48+
- Consider to register Patterns like options using key (name) => value (class) pairs (check performance) ✔️ (_No significant change before 50+ patterns_)
49+
4950
- Extend BuilderPattern, try to add methods:
5051

5152
- group(callable $callback): Creates a grouped subpattern.

searchTest/search.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717
"data.20k.test", // 159ms, 131 ms (17313), 823 ms (17313), 890 ms
1818
];
1919

20+
/*
21+
===========================================================
22+
| ROWS | Found in (count) | F & Decoded | F & D as whole |
23+
===========================================================
24+
| 1000 | 7.6 ms (890) | 44.8 ms | 11.5 ms |
25+
| 2500 | 17.25ms (2186) | 108 ms | 30 ms |
26+
| 5000 | 34.4 ms (4347) | 219 ms | 62 ms |
27+
| 10K | 67.4 ms (8669) | 413 ms | 112 ms |
28+
| 20K | 131 ms (17313) | 823 ms | 251 ms |
29+
===========================================================
30+
===Keyword:="green"========================================
31+
*/
32+
2033
function search($keyword, $file) {
2134
$data = file_get_contents(__DIR__."/".$file);
2235
preg_match_all("/.+(?=$keyword).+/", $data, $matches);

0 commit comments

Comments
 (0)