I have implemented all the neccessary solutions to the List Ops exercise (with due optimization for huge lists) but, even though I can get reasonable times in my local machine, the Exercism server keeps running out of time while testing my solution. I tried:
1 - Community solutions (seems all of them are older then the current exercise version)
2 - ‘Base’ implementation (ok, cheating, but even with Base’s optimized code, the test suite won’t complete)
I looked into this issue a few weeks ago, and the server times out even when you create no-op stubs for all the functions.
The problem here is that the tests want to ensure you are doing tail-call recursion correctly and not cause a recursion limit exception for large input values. To test that, it is creating many lists with at least 1 million elements.
The tests themselves are also doing the same exercise and also generating these huge lists at test time, which is enough to exceed the time limit. See tests.ml.
I have not come up with a solution that greatly reduces testing time but still tests recursion depth limits.
For tracking purposes there is also a relevant GitHub issue here: