Thanks. I think in the situation I’m trying to improve, I’m not using dynamic dispatch. Rather, there is some type instability that is causing allocations. I’m not entirely sure. But as I say, thinking about it more, I doubt I’ll be able to do better (in terms of simplicity) than the solution proposed here.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Function output parametric type assertion | 2 | 668 | November 29, 2019 | |
Type instability of nested recursive function | 4 | 586 | March 28, 2022 | |
Type instability - two examples: yes/no? | 4 | 677 | March 15, 2017 | |
Understanding do notation, type-stability for function with other functions as arguments | 5 | 1291 | July 8, 2019 | |
Type instability possibly due to variable playing role of input and output | 11 | 421 | February 15, 2024 |