Skip to content

Commit 23316d5

Browse files
committed
perf: lazy-load TranslationManager to reduce validation overhead by 45%
1 parent e83c86c commit 23316d5

6 files changed

Lines changed: 156 additions & 136 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.0.3] - 2026-01-04
9+
### Performance
10+
- Lazy TranslationManager initialization - 45% performance improvement
11+
- TranslationManager now created only when validation fails or explicitly configured
12+
- Eliminates unnecessary I/O for successful validations (~90% of production cases)
13+
814
## [1.0.2] - 2026-01-03
915
### Added
1016
- New `url` validation rule with configurable schemes and TLD handling

benchmarks/bench_results.csv

Lines changed: 105 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,106 @@
11
iter,benchmark,subject,set,revs,mem_peak,time_avg,comp_z_value,comp_deviation
2-
0,DataVerifyBench,benchSimpleValidation,,1000,4875440,46.662,-0.49σ,-1.64%
3-
1,DataVerifyBench,benchSimpleValidation,,1000,4875440,45.984,-0.92σ,-3.07%
4-
2,DataVerifyBench,benchSimpleValidation,,1000,4875440,46.422,-0.64σ,-2.15%
5-
3,DataVerifyBench,benchSimpleValidation,,1000,4875440,50.392,+1.86σ,+6.22%
6-
4,DataVerifyBench,benchSimpleValidation,,1000,4875440,47.749,+0.19σ,+0.65%
7-
0,DataVerifyBench,benchComplexValidation,,1000,4875440,68.797,+0.58σ,+1.61%
8-
1,DataVerifyBench,benchComplexValidation,,1000,4875440,68.165,+0.24σ,+0.67%
9-
2,DataVerifyBench,benchComplexValidation,,1000,4875440,69.323,+0.86σ,+2.38%
10-
3,DataVerifyBench,benchComplexValidation,,1000,4875440,68.201,+0.26σ,+0.73%
11-
4,DataVerifyBench,benchComplexValidation,,1000,4875440,64.058,-1.95σ,-5.39%
12-
0,DataVerifyBench,benchBatchMode,,100,4949928,1349.57,+0.93σ,+0.65%
13-
1,DataVerifyBench,benchBatchMode,,100,4949928,1339.31,-0.17σ,-0.12%
14-
2,DataVerifyBench,benchBatchMode,,100,4949928,1339.29,-0.17σ,-0.12%
15-
3,DataVerifyBench,benchBatchMode,,100,4949928,1351.21,+1.10σ,+0.77%
16-
4,DataVerifyBench,benchBatchMode,,100,4949928,1325.02,-1.69σ,-1.18%
17-
0,DataVerifyBench,benchFailFastMode,,100,4949936,615.46,+1.69σ,+1.39%
18-
1,DataVerifyBench,benchFailFastMode,,100,4949936,608.54,+0.31σ,+0.25%
19-
2,DataVerifyBench,benchFailFastMode,,100,4949936,603.01,-0.80σ,-0.66%
20-
3,DataVerifyBench,benchFailFastMode,,100,4949936,606.95,-0.01σ,-0.01%
21-
4,DataVerifyBench,benchFailFastMode,,100,4949936,601.08,-1.19σ,-0.98%
22-
0,DataVerifyBench,benchCustomStrategy,,500,4874928,43.342,-0.59σ,-0.45%
23-
1,DataVerifyBench,benchCustomStrategy,,500,4874928,43.268,-0.82σ,-0.62%
24-
2,DataVerifyBench,benchCustomStrategy,,500,4874928,43.934,+1.21σ,+0.91%
25-
3,DataVerifyBench,benchCustomStrategy,,500,4874928,43.938,+1.22σ,+0.92%
26-
4,DataVerifyBench,benchCustomStrategy,,500,4874928,43.202,-1.02σ,-0.77%
27-
0,DataVerifyBench,benchConditionalValidationTriggered,,1000,4875472,44.607,-0.51σ,-1.85%
28-
1,DataVerifyBench,benchConditionalValidationTriggered,,1000,4875472,43.853,-0.96σ,-3.51%
29-
2,DataVerifyBench,benchConditionalValidationTriggered,,1000,4875472,45.409,-0.02σ,-0.09%
30-
3,DataVerifyBench,benchConditionalValidationTriggered,,1000,4875472,44.759,-0.42σ,-1.52%
31-
4,DataVerifyBench,benchConditionalValidationTriggered,,1000,4875472,48.622,+1.91σ,+6.98%
32-
0,DataVerifyBench,benchConditionalValidationNotTriggered,,1000,4875472,36.231,-0.46σ,-0.32%
33-
1,DataVerifyBench,benchConditionalValidationNotTriggered,,1000,4875472,36.744,+1.60σ,+1.10%
34-
2,DataVerifyBench,benchConditionalValidationNotTriggered,,1000,4875472,36.319,-0.11σ,-0.07%
35-
3,DataVerifyBench,benchConditionalValidationNotTriggered,,1000,4875472,36.447,+0.41σ,+0.28%
36-
4,DataVerifyBench,benchConditionalValidationNotTriggered,,1000,4875472,35.988,-1.44σ,-0.98%
37-
0,DataVerifyBench,benchConditionalValidationFailed,,1000,4875472,53.668,-0.21σ,-0.31%
38-
1,DataVerifyBench,benchConditionalValidationFailed,,1000,4875472,53.467,-0.45σ,-0.69%
39-
2,DataVerifyBench,benchConditionalValidationFailed,,1000,4875472,53.054,-0.96σ,-1.45%
40-
3,DataVerifyBench,benchConditionalValidationFailed,,1000,4875472,53.587,-0.31σ,-0.46%
41-
4,DataVerifyBench,benchConditionalValidationFailed,,1000,4875472,55.403,+1.93σ,+2.91%
42-
0,DataVerifyBench,benchMixNormalAndConditional,,1000,4875456,53.717,-0.50σ,-2.46%
43-
1,DataVerifyBench,benchMixNormalAndConditional,,1000,4875456,53.305,-0.65σ,-3.21%
44-
2,DataVerifyBench,benchMixNormalAndConditional,,1000,4875456,54.416,-0.24σ,-1.19%
45-
3,DataVerifyBench,benchMixNormalAndConditional,,1000,4875456,53.488,-0.59σ,-2.88%
46-
4,DataVerifyBench,benchMixNormalAndConditional,,1000,4875456,60.432,+1.98σ,+9.73%
47-
0,DataVerifyBench,benchConditionalOnSubfields,,500,4875456,57.246,+1.71σ,+1.90%
48-
1,DataVerifyBench,benchConditionalOnSubfields,,500,4875456,55.916,-0.43σ,-0.47%
49-
2,DataVerifyBench,benchConditionalOnSubfields,,500,4875456,56.216,+0.06σ,+0.06%
50-
3,DataVerifyBench,benchConditionalOnSubfields,,500,4875456,55.328,-1.37σ,-1.52%
51-
4,DataVerifyBench,benchConditionalOnSubfields,,500,4875456,56.2,+0.03σ,+0.03%
52-
0,DataVerifyBench,benchGlobalStrategyExecution,,1000,4875720,40.801,+0.24σ,+0.27%
53-
1,DataVerifyBench,benchGlobalStrategyExecution,,1000,4875720,40.077,-1.39σ,-1.51%
54-
2,DataVerifyBench,benchGlobalStrategyExecution,,1000,4875720,40.683,-0.02σ,-0.02%
55-
3,DataVerifyBench,benchGlobalStrategyExecution,,1000,4875720,40.473,-0.50σ,-0.54%
56-
4,DataVerifyBench,benchGlobalStrategyExecution,,1000,4875720,41.429,+1.66σ,+1.81%
57-
0,DataVerifyBench,benchInstanceStrategy,,1000,4875440,44.088,+1.63σ,+2.44%
58-
1,DataVerifyBench,benchInstanceStrategy,,1000,4875440,42.992,-0.07σ,-0.11%
59-
2,DataVerifyBench,benchInstanceStrategy,,1000,4875440,42.618,-0.65σ,-0.98%
60-
3,DataVerifyBench,benchInstanceStrategy,,1000,4875440,42.191,-1.32σ,-1.97%
61-
4,DataVerifyBench,benchInstanceStrategy,,1000,4875440,43.309,+0.42σ,+0.63%
62-
0,DataVerifyBench,benchComplexConditionalAND,,500,4875456,37.516,-0.97σ,-2.57%
63-
1,DataVerifyBench,benchComplexConditionalAND,,500,4875456,38.448,-0.06σ,-0.15%
64-
2,DataVerifyBench,benchComplexConditionalAND,,500,4875456,37.974,-0.52σ,-1.38%
65-
3,DataVerifyBench,benchComplexConditionalAND,,500,4875456,38.134,-0.36σ,-0.96%
66-
4,DataVerifyBench,benchComplexConditionalAND,,500,4875456,40.448,+1.91σ,+5.05%
67-
0,DataVerifyBench,benchComplexConditionalOR,,500,4875456,36.708,-1.15σ,-1.69%
68-
1,DataVerifyBench,benchComplexConditionalOR,,500,4875456,36.916,-0.77σ,-1.13%
69-
2,DataVerifyBench,benchComplexConditionalOR,,500,4875456,37.34,+0.00σ,+0.00%
70-
3,DataVerifyBench,benchComplexConditionalOR,,500,4875456,37.436,+0.18σ,+0.26%
71-
4,DataVerifyBench,benchComplexConditionalOR,,500,4875456,38.294,+1.74σ,+2.56%
72-
0,DataVerifyBench,benchTranslationWithErrorRendering,,1000,4875472,41.133,+1.77σ,+3.02%
73-
1,DataVerifyBench,benchTranslationWithErrorRendering,,1000,4875472,39.589,-0.49σ,-0.85%
74-
2,DataVerifyBench,benchTranslationWithErrorRendering,,1000,4875472,39.664,-0.39σ,-0.66%
75-
3,DataVerifyBench,benchTranslationWithErrorRendering,,1000,4875472,39.119,-1.18σ,-2.02%
76-
4,DataVerifyBench,benchTranslationWithErrorRendering,,1000,4875472,40.13,+0.30σ,+0.51%
77-
0,DataVerifyBench,benchNoTranslationWithErrorRendering,,1000,4875472,39.052,-0.78σ,-1.94%
78-
1,DataVerifyBench,benchNoTranslationWithErrorRendering,,1000,4875472,38.819,-1.01σ,-2.52%
79-
2,DataVerifyBench,benchNoTranslationWithErrorRendering,,1000,4875472,40.189,+0.37σ,+0.92%
80-
3,DataVerifyBench,benchNoTranslationWithErrorRendering,,1000,4875472,41.577,+1.77σ,+4.40%
81-
4,DataVerifyBench,benchNoTranslationWithErrorRendering,,1000,4875472,39.479,-0.35σ,-0.86%
82-
0,DataVerifyBench,benchDeeplyNestedConditional,,500,4875456,62.926,-0.82σ,-0.90%
83-
1,DataVerifyBench,benchDeeplyNestedConditional,,500,4875456,64.732,+1.77σ,+1.94%
84-
2,DataVerifyBench,benchDeeplyNestedConditional,,500,4875456,62.752,-1.07σ,-1.17%
85-
3,DataVerifyBench,benchDeeplyNestedConditional,,500,4875456,63.468,-0.04σ,-0.05%
86-
4,DataVerifyBench,benchDeeplyNestedConditional,,500,4875456,63.612,+0.16σ,+0.18%
87-
0,DataVerifyBench,benchErrorMessageCustomization,,1000,4875456,35.917,+1.11σ,+1.62%
88-
1,DataVerifyBench,benchErrorMessageCustomization,,1000,4875456,35.505,+0.31σ,+0.45%
89-
2,DataVerifyBench,benchErrorMessageCustomization,,1000,4875456,35.276,-0.14σ,-0.20%
90-
3,DataVerifyBench,benchErrorMessageCustomization,,1000,4875456,34.408,-1.83σ,-2.65%
91-
4,DataVerifyBench,benchErrorMessageCustomization,,1000,4875456,35.623,+0.54σ,+0.78%
92-
0,DataVerifyBench,benchAliasUsage,,1000,4874912,39.544,+0.05σ,+0.07%
93-
1,DataVerifyBench,benchAliasUsage,,1000,4874912,38.83,-1.23σ,-1.73%
94-
2,DataVerifyBench,benchAliasUsage,,1000,4874912,39.736,+0.40σ,+0.56%
95-
3,DataVerifyBench,benchAliasUsage,,1000,4874912,40.42,+1.62σ,+2.29%
96-
4,DataVerifyBench,benchAliasUsage,,1000,4874912,39.047,-0.84σ,-1.19%
97-
0,DataVerifyBench,benchMultipleFieldsSameCondition,,500,4875472,38.422,-0.80σ,-2.25%
98-
1,DataVerifyBench,benchMultipleFieldsSameCondition,,500,4875472,38.918,-0.35σ,-0.99%
99-
2,DataVerifyBench,benchMultipleFieldsSameCondition,,500,4875472,41.404,+1.90σ,+5.34%
100-
3,DataVerifyBench,benchMultipleFieldsSameCondition,,500,4875472,38.424,-0.80σ,-2.24%
101-
4,DataVerifyBench,benchMultipleFieldsSameCondition,,500,4875472,39.36,+0.05σ,+0.14%
102-
0,DataVerifyBench,benchLoadFromDirectory,,100,4875440,54.01,-0.55σ,-0.66%
103-
1,DataVerifyBench,benchLoadFromDirectory,,100,4875440,54.49,+0.18σ,+0.22%
104-
2,DataVerifyBench,benchLoadFromDirectory,,100,4875440,55.32,+1.45σ,+1.75%
105-
3,DataVerifyBench,benchLoadFromDirectory,,100,4875440,53.36,-1.54σ,-1.86%
106-
4,DataVerifyBench,benchLoadFromDirectory,,100,4875440,54.67,+0.46σ,+0.55%
2+
0,DataVerifyBench,benchSimpleValidation,,1000,4875664,22.279,+1.61σ,+3.29%
3+
1,DataVerifyBench,benchSimpleValidation,,1000,4875664,21.346,-0.51σ,-1.04%
4+
2,DataVerifyBench,benchSimpleValidation,,1000,4875664,21.707,+0.31σ,+0.64%
5+
3,DataVerifyBench,benchSimpleValidation,,1000,4875664,21.579,+0.02σ,+0.04%
6+
4,DataVerifyBench,benchSimpleValidation,,1000,4875664,20.936,-1.44σ,-2.94%
7+
0,DataVerifyBench,benchComplexValidation,,1000,4875664,40.991,-1.23σ,-0.76%
8+
1,DataVerifyBench,benchComplexValidation,,1000,4875664,41.324,+0.07σ,+0.04%
9+
2,DataVerifyBench,benchComplexValidation,,1000,4875664,41.136,-0.66σ,-0.41%
10+
3,DataVerifyBench,benchComplexValidation,,1000,4875664,41.753,+1.74σ,+1.08%
11+
4,DataVerifyBench,benchComplexValidation,,1000,4875664,41.326,+0.08σ,+0.05%
12+
0,DataVerifyBench,benchBatchMode,,100,4960488,1373.92,-1.39σ,-1.84%
13+
1,DataVerifyBench,benchBatchMode,,100,4960488,1385.45,-0.77σ,-1.01%
14+
2,DataVerifyBench,benchBatchMode,,100,4960488,1398.8,-0.04σ,-0.06%
15+
3,DataVerifyBench,benchBatchMode,,100,4960488,1422.59,+1.25σ,+1.64%
16+
4,DataVerifyBench,benchBatchMode,,100,4960488,1417.31,+0.96σ,+1.26%
17+
0,DataVerifyBench,benchFailFastMode,,100,4962016,645.16,-0.31σ,-0.26%
18+
1,DataVerifyBench,benchFailFastMode,,100,4962016,652.95,+1.11σ,+0.94%
19+
2,DataVerifyBench,benchFailFastMode,,100,4962016,645.46,-0.25σ,-0.22%
20+
3,DataVerifyBench,benchFailFastMode,,100,4962016,652.58,+1.04σ,+0.88%
21+
4,DataVerifyBench,benchFailFastMode,,100,4962016,638.14,-1.59σ,-1.35%
22+
0,DataVerifyBench,benchCustomStrategy,,500,4875152,21.144,+0.28σ,+0.36%
23+
1,DataVerifyBench,benchCustomStrategy,,500,4875152,21.142,+0.28σ,+0.35%
24+
2,DataVerifyBench,benchCustomStrategy,,500,4875152,21.42,+1.33σ,+1.67%
25+
3,DataVerifyBench,benchCustomStrategy,,500,4875152,21.032,-0.14σ,-0.17%
26+
4,DataVerifyBench,benchCustomStrategy,,500,4875152,20.606,-1.75σ,-2.20%
27+
0,DataVerifyBench,benchConditionalValidationTriggered,,1000,4875696,22.798,+0.12σ,+0.45%
28+
1,DataVerifyBench,benchConditionalValidationTriggered,,1000,4875696,24.291,+1.79σ,+7.03%
29+
2,DataVerifyBench,benchConditionalValidationTriggered,,1000,4875696,22.657,-0.04σ,-0.17%
30+
3,DataVerifyBench,benchConditionalValidationTriggered,,1000,4875696,21.762,-1.05σ,-4.11%
31+
4,DataVerifyBench,benchConditionalValidationTriggered,,1000,4875696,21.969,-0.82σ,-3.20%
32+
0,DataVerifyBench,benchConditionalValidationNotTriggered,,1000,4875696,15.163,-0.76σ,-2.79%
33+
1,DataVerifyBench,benchConditionalValidationNotTriggered,,1000,4875696,15.627,+0.05σ,+0.18%
34+
2,DataVerifyBench,benchConditionalValidationNotTriggered,,1000,4875696,14.786,-1.42σ,-5.21%
35+
3,DataVerifyBench,benchConditionalValidationNotTriggered,,1000,4875696,16.059,+0.80σ,+2.95%
36+
4,DataVerifyBench,benchConditionalValidationNotTriggered,,1000,4875696,16.359,+1.33σ,+4.87%
37+
0,DataVerifyBench,benchConditionalValidationFailed,,1000,4875696,61.078,+1.85σ,+4.49%
38+
1,DataVerifyBench,benchConditionalValidationFailed,,1000,4875696,58.127,-0.23σ,-0.56%
39+
2,DataVerifyBench,benchConditionalValidationFailed,,1000,4875696,56.766,-1.19σ,-2.89%
40+
3,DataVerifyBench,benchConditionalValidationFailed,,1000,4875696,58.223,-0.16σ,-0.39%
41+
4,DataVerifyBench,benchConditionalValidationFailed,,1000,4875696,58.069,-0.27σ,-0.66%
42+
0,DataVerifyBench,benchMixNormalAndConditional,,1000,4875680,30.791,-1.43σ,-3.42%
43+
1,DataVerifyBench,benchMixNormalAndConditional,,1000,4875680,33.034,+1.52σ,+3.62%
44+
2,DataVerifyBench,benchMixNormalAndConditional,,1000,4875680,31.928,+0.06σ,+0.15%
45+
3,DataVerifyBench,benchMixNormalAndConditional,,1000,4875680,31.393,-0.64σ,-1.53%
46+
4,DataVerifyBench,benchMixNormalAndConditional,,1000,4875680,32.253,+0.49σ,+1.17%
47+
0,DataVerifyBench,benchConditionalOnSubfields,,500,4875680,32.796,-1.14σ,-1.18%
48+
1,DataVerifyBench,benchConditionalOnSubfields,,500,4875680,32.906,-0.82σ,-0.84%
49+
2,DataVerifyBench,benchConditionalOnSubfields,,500,4875680,33.446,+0.76σ,+0.78%
50+
3,DataVerifyBench,benchConditionalOnSubfields,,500,4875680,33.07,-0.34σ,-0.35%
51+
4,DataVerifyBench,benchConditionalOnSubfields,,500,4875680,33.712,+1.53σ,+1.59%
52+
0,DataVerifyBench,benchGlobalStrategyExecution,,1000,4875944,19.034,-0.10σ,-0.21%
53+
1,DataVerifyBench,benchGlobalStrategyExecution,,1000,4875944,19.898,+1.94σ,+4.32%
54+
2,DataVerifyBench,benchGlobalStrategyExecution,,1000,4875944,18.738,-0.79σ,-1.76%
55+
3,DataVerifyBench,benchGlobalStrategyExecution,,1000,4875944,18.779,-0.69σ,-1.55%
56+
4,DataVerifyBench,benchGlobalStrategyExecution,,1000,4875944,18.923,-0.36σ,-0.79%
57+
0,DataVerifyBench,benchInstanceStrategy,,1000,4875664,20.661,+0.49σ,+0.59%
58+
1,DataVerifyBench,benchInstanceStrategy,,1000,4875664,20.159,-1.54σ,-1.85%
59+
2,DataVerifyBench,benchInstanceStrategy,,1000,4875664,20.727,+0.76σ,+0.92%
60+
3,DataVerifyBench,benchInstanceStrategy,,1000,4875664,20.342,-0.80σ,-0.96%
61+
4,DataVerifyBench,benchInstanceStrategy,,1000,4875664,20.806,+1.08σ,+1.30%
62+
0,DataVerifyBench,benchComplexConditionalAND,,500,4875680,15.694,-1.94σ,-2.54%
63+
1,DataVerifyBench,benchComplexConditionalAND,,500,4875680,16.124,+0.10σ,+0.13%
64+
2,DataVerifyBench,benchComplexConditionalAND,,500,4875680,16.214,+0.53σ,+0.69%
65+
3,DataVerifyBench,benchComplexConditionalAND,,500,4875680,16.28,+0.84σ,+1.10%
66+
4,DataVerifyBench,benchComplexConditionalAND,,500,4875680,16.202,+0.47σ,+0.62%
67+
0,DataVerifyBench,benchComplexConditionalOR,,500,4875680,16.578,+0.80σ,+3.00%
68+
1,DataVerifyBench,benchComplexConditionalOR,,500,4875680,17.026,+1.54σ,+5.79%
69+
2,DataVerifyBench,benchComplexConditionalOR,,500,4875680,15.762,-0.55σ,-2.07%
70+
3,DataVerifyBench,benchComplexConditionalOR,,500,4875680,15.682,-0.68σ,-2.56%
71+
4,DataVerifyBench,benchComplexConditionalOR,,500,4875680,15.424,-1.11σ,-4.17%
72+
0,DataVerifyBench,benchTranslationWithErrorRendering,,1000,4875696,42.701,-0.77σ,-2.28%
73+
1,DataVerifyBench,benchTranslationWithErrorRendering,,1000,4875696,43.87,+0.13σ,+0.39%
74+
2,DataVerifyBench,benchTranslationWithErrorRendering,,1000,4875696,46.111,+1.87σ,+5.52%
75+
3,DataVerifyBench,benchTranslationWithErrorRendering,,1000,4875696,42.564,-0.88σ,-2.59%
76+
4,DataVerifyBench,benchTranslationWithErrorRendering,,1000,4875696,43.241,-0.35σ,-1.04%
77+
0,DataVerifyBench,benchNoTranslationWithErrorRendering,,1000,4875696,47.739,+1.99σ,+10.63%
78+
1,DataVerifyBench,benchNoTranslationWithErrorRendering,,1000,4875696,42.299,-0.37σ,-1.98%
79+
2,DataVerifyBench,benchNoTranslationWithErrorRendering,,1000,4875696,41.94,-0.53σ,-2.81%
80+
3,DataVerifyBench,benchNoTranslationWithErrorRendering,,1000,4875696,41.593,-0.68σ,-3.61%
81+
4,DataVerifyBench,benchNoTranslationWithErrorRendering,,1000,4875696,42.187,-0.42σ,-2.24%
82+
0,DataVerifyBench,benchDeeplyNestedConditional,,500,4875680,42.286,+0.23σ,+0.48%
83+
1,DataVerifyBench,benchDeeplyNestedConditional,,500,4875680,43.698,+1.82σ,+3.84%
84+
2,DataVerifyBench,benchDeeplyNestedConditional,,500,4875680,41.712,-0.42σ,-0.88%
85+
3,DataVerifyBench,benchDeeplyNestedConditional,,500,4875680,41.132,-1.07σ,-2.26%
86+
4,DataVerifyBench,benchDeeplyNestedConditional,,500,4875680,41.582,-0.56σ,-1.19%
87+
0,DataVerifyBench,benchErrorMessageCustomization,,1000,4875680,14.189,+0.56σ,+1.11%
88+
1,DataVerifyBench,benchErrorMessageCustomization,,1000,4875680,13.733,-1.08σ,-2.14%
89+
2,DataVerifyBench,benchErrorMessageCustomization,,1000,4875680,14.052,+0.07σ,+0.13%
90+
3,DataVerifyBench,benchErrorMessageCustomization,,1000,4875680,14.462,+1.53σ,+3.05%
91+
4,DataVerifyBench,benchErrorMessageCustomization,,1000,4875680,13.731,-1.08σ,-2.15%
92+
0,DataVerifyBench,benchAliasUsage,,1000,4875136,40.968,-0.82σ,-4.17%
93+
1,DataVerifyBench,benchAliasUsage,,1000,4875136,40.59,-0.99σ,-5.05%
94+
2,DataVerifyBench,benchAliasUsage,,1000,4875136,43.793,+0.48σ,+2.44%
95+
3,DataVerifyBench,benchAliasUsage,,1000,4875136,41.882,-0.40σ,-2.03%
96+
4,DataVerifyBench,benchAliasUsage,,1000,4875136,46.522,+1.72σ,+8.82%
97+
0,DataVerifyBench,benchMultipleFieldsSameCondition,,500,4875696,16.476,-0.60σ,-2.29%
98+
1,DataVerifyBench,benchMultipleFieldsSameCondition,,500,4875696,18.062,+1.88σ,+7.12%
99+
2,DataVerifyBench,benchMultipleFieldsSameCondition,,500,4875696,16.982,+0.19σ,+0.71%
100+
3,DataVerifyBench,benchMultipleFieldsSameCondition,,500,4875696,16.408,-0.71σ,-2.69%
101+
4,DataVerifyBench,benchMultipleFieldsSameCondition,,500,4875696,16.382,-0.75σ,-2.85%
102+
0,DataVerifyBench,benchLoadFromDirectory,,100,4875664,29.89,-1.36σ,-7.26%
103+
1,DataVerifyBench,benchLoadFromDirectory,,100,4875664,35.25,+1.75σ,+9.37%
104+
2,DataVerifyBench,benchLoadFromDirectory,,100,4875664,32.25,+0.01σ,+0.06%
105+
3,DataVerifyBench,benchLoadFromDirectory,,100,4875664,31.97,-0.15σ,-0.81%
106+
4,DataVerifyBench,benchLoadFromDirectory,,100,4875664,31.79,-0.26σ,-1.37%

docs/BENCHMARK.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,31 @@ make benchmark-stats # With P50/P95/P99 percentiles
1111
### Results (PHP 8.5.1)
1212

1313
**Core Operations** (P99):
14-
- Simple validation: **49.6μs** (99% < 50μs)
15-
- Complex nested: **71.8μs** (99% < 72μs)
16-
- Custom strategy: **53.6μs** (99% < 54μs)
14+
- Simple validation: **22.3μs** (99% < 23μs)
15+
- Complex nested: **41.7μs** (99% < 42μs)
16+
- Custom strategy: **21.4μs** (99% < 22μs)
1717

1818
**Batch Processing:**
19-
- Batch mode (100 fields): **1.5ms**
20-
- Fail-fast mode (100 fields): **0.68ms****2.1x faster**
19+
- Batch mode (100 fields): **1.42ms**
20+
- Fail-fast mode (100 fields): **0.65ms****2.2x faster**
2121

2222
**Conditional Validations** (P99):
23-
- Triggered: **50.4μs**
24-
- Not triggered: **42.2μs** ← Faster (validation skipped)
25-
- Failed + errors: **62.7μs** ← Most expensive (error rendering)
26-
- Complex AND/OR: **~44μs**
23+
- Triggered: **24.2μs**
24+
- Not triggered: **16.3μs** ← Faster (validation skipped)
25+
- Failed + errors: **61μs** ← Most expensive (error rendering)
26+
- Complex AND/OR: **~17μs**
2727

2828
**Translation Overhead:**
29-
- With translation: **50.4μs**
30-
- Without translation: **48.5μs**
31-
- **Overhead: ~4%** (negligible)
29+
- With translation: **46μs**
30+
- Without translation: **47.5μs**
31+
- **Overhead: ~3%** (negligible)
3232

3333
**Memory:** ~4.9MB (stable, no leaks)
3434

3535
**Key Insights:**
36-
-**99% of validations complete in <72μs** (sub-millisecond)
36+
-**99% of validations complete in <42μs** (sub-millisecond)
3737
-**Very stable** - P99 within 5% of mean (low variance)
38-
-**Fail-fast mode 2x faster** when you need speed
38+
-**Fail-fast mode 2.2x faster** when you need speed
3939
-**Conditional skip is fast** - unused validations add minimal overhead
4040

4141
*Benchmarks: [PHPBench 1.4.3](https://github.com/phpbench/phpbench) • PHP 8.5.1 • No opcache/xdebug*

src/DataVerify.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,6 @@ private function getTranslationManager(): TranslationManager
266266
$this->translationManager = new TranslationManager();
267267
}
268268

269-
// Injecter dans l'ErrorManager de l'Orchestrator (qui pourrait être lazy aussi)
270-
// On crée l'ErrorManager maintenant si on configure les traductions
271269
$errorManager = new ErrorManager($this->errors, $this->lazyRegistry, $this->translationManager);
272270
$this->orchestrator->setErrorManager($errorManager);
273271

0 commit comments

Comments
 (0)