Commit 1dfd9bd
Fix allocation issue with accepted_kwargs by using Val types
This commit resolves issue SciML#312 by converting accepted_kwargs tuples
to Val types for compile-time kwarg filtering, eliminating runtime
allocations.
Changes:
- Modified preprocess_update_func to automatically convert tuple
accepted_kwargs to Val types
- Updated get_filtered_kwargs to handle missing keys gracefully
when using Val types
This follows the same pattern introduced in PR SciML#255 for FunctionOperator
but extends it to all operators (MatrixOperator, AffineOperator, etc.)
by fixing it at the preprocess_update_func level.
Before: 9 allocations (272 bytes) when using accepted_kwargs
After: 0 allocations
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 1bc1531 commit 1dfd9bd
1 file changed
+11
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
18 | 25 | | |
19 | 26 | | |
20 | 27 | | |
| |||
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
49 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
50 | 59 | | |
51 | 60 | | |
52 | 61 | | |
| |||
0 commit comments