Commit a705f6c
authored
perf(string-methods): Pre-compute character mappings for O(1) lookup (#58)
* perf(string-methods): Pre-compute character mappings for O(1) lookup
Replace runtime array operations with compile-time constants for
significant performance improvements in searchWords() and
removeAccents().
- Add SEARCH_WORDS_MAPPING constant with lowercase accent mappings
- Add ACCENT_MAPPING constant for case-preserving accent removal
- Simplify searchWords() to single strtr() call with constant
- Simplify removeAccents() to single strtr() call with constant
- Remove unused $searchWordsMapping static property
- Remove unused applyBasicNameFix() method
- Remove legacy REMOVE_ACCENTS_FROM/TO arrays
- Add IsValidTimePartTest for 100% code coverage
- Fix composer.json psalm plugin dependency
Performance: removeAccents +66%, searchWords +104%, nameFix +39%
Signed-off-by: Marjo Wenzel van Lier <marjo.vanlier@gmail.com>
* docs(performance): Update for pre-computed constants
Reflect the new implementation using compile-time constants instead
of lazy-initialised static properties.
- Update benchmark numbers to reflect +66% to +104% improvements
- Replace lazy init examples with pre-computed constant examples
- Update "Static Caching" section to "Compile-Time Constants"
- Replace "Pre-warm Cache" with "No Warm-up Required"
- Update comparison table with new performance figures
Signed-off-by: Marjo Wenzel van Lier <marjo.vanlier@gmail.com>
* build(php): Add PHP 8.5 to CI test matrix
Extend CI pipeline to test against PHP 8.5 in addition to 8.3 and 8.4.
Signed-off-by: Marjo Wenzel van Lier <marjo.vanlier@gmail.com>
* build(deps): Remove Psalm for PHP 8.5 compatibility
Psalm does not yet support PHP 8.5. Remove vimeo/psalm and
psalm/plugin-phpunit from dependencies while keeping composer
scripts for use on PHP 8.3/8.4.
- Remove vimeo/psalm and psalm/plugin-phpunit from require-dev
- Skip psalm step in CI for PHP 8.5 matrix
- Adjust rector step to run after phan when psalm is skipped
Signed-off-by: Marjo Wenzel van Lier <marjo.vanlier@gmail.com>
* fix(ci): Restore Psalm with PHP 8.5 workaround
Restore vimeo/psalm dependency so it runs on PHP 8.3/8.4. Use
--ignore-platform-req=php when installing on PHP 8.5 to allow
packages that don't yet declare 8.5 support.
Signed-off-by: Marjo Wenzel van Lier <marjo.vanlier@gmail.com>
* build(ci): Remove Psalm from CI and dependencies
Remove vimeo/psalm from dependencies due to PHP 8.5
incompatibility. Psalm does not yet support PHP 8.5 and
was causing CI failures on the 8.5 matrix.
Changes:
- Remove vimeo/psalm from require-dev
- Remove @test:psalm from tests sequence
- Remove @test:psalm from analyse:all
- Remove psalm step from CI workflow
- Simplify rector step condition
Script definitions retained for manual use on PHP 8.3/8.4.
Signed-off-by: Marjo Wenzel van Lier <marjo.vanlier@gmail.com>
* build(ci): Remove Phan from CI and dependencies
Remove phan/phan from dependencies due to PHP 8.5
incompatibility. Phan crashes when parsing vendor files
on PHP 8.5 due to deprecated syntax handling.
Changes:
- Remove phan/phan from require-dev
- Remove @test:phan from tests sequence
- Remove @test:phan from analyse:all
- Remove phan step from CI workflow
- Remove test-phan and test-psalm services from docker
- Update test-all command in docker-compose
Script definitions retained for manual use on PHP 8.3/8.4.
Signed-off-by: Marjo Wenzel van Lier <marjo.vanlier@gmail.com>
---------
Signed-off-by: Marjo Wenzel van Lier <marjo.vanlier@gmail.com>1 parent 6e73ab3 commit a705f6c
10 files changed
Lines changed: 624 additions & 795 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| |||
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | 120 | | |
127 | 121 | | |
128 | 122 | | |
129 | | - | |
| 123 | + | |
130 | 124 | | |
131 | 125 | | |
132 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
61 | | - | |
62 | 60 | | |
63 | 61 | | |
64 | 62 | | |
65 | | - | |
66 | | - | |
| 63 | + | |
67 | 64 | | |
68 | 65 | | |
69 | 66 | | |
| |||
96 | 93 | | |
97 | 94 | | |
98 | 95 | | |
99 | | - | |
100 | | - | |
101 | 96 | | |
102 | 97 | | |
103 | 98 | | |
| |||
114 | 109 | | |
115 | 110 | | |
116 | 111 | | |
117 | | - | |
118 | | - | |
119 | | - | |
| 112 | + | |
120 | 113 | | |
121 | 114 | | |
122 | 115 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 25 | | |
37 | 26 | | |
38 | 27 | | |
| |||
62 | 51 | | |
63 | 52 | | |
64 | 53 | | |
65 | | - | |
66 | | - | |
67 | 54 | | |
68 | 55 | | |
69 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 54 | + | |
| 55 | + | |
61 | 56 | | |
62 | 57 | | |
63 | 58 | | |
| |||
71 | 66 | | |
72 | 67 | | |
73 | 68 | | |
74 | | - | |
| 69 | + | |
75 | 70 | | |
76 | | - | |
| 71 | + | |
77 | 72 | | |
78 | | - | |
79 | | - | |
80 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
81 | 76 | | |
82 | | - | |
83 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
84 | 81 | | |
85 | 82 | | |
86 | 83 | | |
| |||
193 | 190 | | |
194 | 191 | | |
195 | 192 | | |
196 | | - | |
| 193 | + | |
197 | 194 | | |
198 | | - | |
| 195 | + | |
199 | 196 | | |
200 | 197 | | |
201 | | - | |
202 | | - | |
203 | | - | |
| 198 | + | |
| 199 | + | |
204 | 200 | | |
205 | 201 | | |
206 | 202 | | |
| |||
211 | 207 | | |
212 | 208 | | |
213 | 209 | | |
214 | | - | |
| 210 | + | |
215 | 211 | | |
216 | 212 | | |
217 | 213 | | |
| |||
0 commit comments