Commit 1b613b1
Add fast-path and use Class keys in AllowlistReturnTypeValidator
String/Number/Boolean are always allowed return types, so skip the
ConcurrentHashMap lookup entirely. Also changed the cache key from
String (canonical class name) to Class<?> to avoid the cost of
getCanonicalName() on cache hits.
Benchmark: +64% throughput on complexTemplateBenchmark (3,316 -> 5,428 ops/s)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent e2275c1 commit 1b613b1
1 file changed
Lines changed: 12 additions & 6 deletions
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
54 | | - | |
55 | 57 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
| |||
0 commit comments