Yes I should have mentioned that they use quite different amounts of memory. But I am still surprised. First of all when I call it with n=17, T is a tiny set (9 elements). Moreover, both are suppose to return a function and the code for that function is identical. So when you run them they presumably should do the exact same thing regardless of the extra code in the exterior function block.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Inner function overhead | 2 | 690 | February 3, 2019 | |
| Very strange performance issue of a simple code | 4 | 595 | June 16, 2019 | |
| Resource consumption of nested functions | 0 | 512 | February 9, 2017 | |
| Extra allocations/time when a function is returned from another function than defined directly | 6 | 333 | May 30, 2022 | |
| Running small functions bundled in an outer function taking twice the time of running them separately | 7 | 1085 | April 2, 2020 |