It is very hard to answer this question without an MWE we can run, to see how you implemented it, what the functions look like typically, the scale of the problem, etc.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Getting non-vectorized code to the speed of vectorized ones | 22 | 1231 | November 18, 2021 | |
| How to build functions that work efficiently with arguments of different types? | 15 | 1458 | November 23, 2021 | |
| Replace for loop with vectorized call of a function that returns multiple values | 1 | 546 | December 27, 2020 | |
| Optimizing dynamical system in a network | 15 | 416 | November 13, 2023 | |
| Static vector of functions as a field of a composite type | 4 | 632 | May 20, 2023 |