Commit 5702e51
perf: Cache MakeGenericMethod calls in delegate factories
Add ConcurrentDictionary caches for MethodInfo instances created via
MakeGenericMethod in ModuleExecutionDelegateFactory and
ResultRepositoryDelegateFactory. This avoids repeated reflection calls
for the same type arguments.
Changes:
- Cache ExecuteAsync and ExecuteAndCastAsync generic method instances
in ModuleExecutionDelegateFactory
- Cache GetResultAsync and GetResultAndCastAsync generic method instances
in ResultRepositoryDelegateFactory
- Cache base method definitions as static readonly fields for reuse
Fixes #1474
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 9bd172e commit 5702e51
2 files changed
Lines changed: 48 additions & 16 deletions
File tree
- src/ModularPipelines/Engine/Execution
Lines changed: 24 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
31 | 47 | | |
32 | 48 | | |
33 | 49 | | |
| |||
59 | 75 | | |
60 | 76 | | |
61 | 77 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
66 | 82 | | |
67 | 83 | | |
68 | 84 | | |
| |||
74 | 90 | | |
75 | 91 | | |
76 | 92 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
81 | 97 | | |
82 | 98 | | |
83 | 99 | | |
| |||
Lines changed: 24 additions & 8 deletions
| 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 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
25 | 41 | | |
26 | 42 | | |
27 | 43 | | |
| |||
42 | 58 | | |
43 | 59 | | |
44 | 60 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
49 | 65 | | |
50 | 66 | | |
51 | 67 | | |
52 | 68 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
57 | 73 | | |
58 | 74 | | |
59 | 75 | | |
| |||
0 commit comments