timelimit() has improved in Maple 2021, and I thought it works now for everything.
But unfortunately,, it still hangs on some dsolves when I was testing something. Here is an example
The above has one minute timeout. But its been running for 20 minutes now. Here is another example that hangs
ode:=(diff(y(x),x) = (-y(x)^2+4*a*x)^3/(-y(x)^2+4*a*x-1)/y(x));
I have found many more dsolve examples that hang with timelimit. Will update later. May be they will help find the cause.
Hopefully this timelimit issue will be fixed in some future release. hangs in Maple commands even when using timelimit makes it very hard to run long scripts that run over many problems, since do not know when/where it will hang and have to restart and clean things manually each time.
Window 10. Maple 2021
Update March 15,2022
Here is another example of timelimit taking so much longer than asking for, it is pretty much useless.
I will use this question to collect such examples in one place. Here I asked for one minute (60 seconds, CPU time) timeout. Maple actually timedout after using 1381 CPU seconds which is 23 times as much as requested.
The timelimit function evaluates the expression x, but gives up if the evaluation takes longer than the number of seconds specified by t.
Note: In some cases, the execution may not abort at exactly the time limit imposed, but will abort as soon as it can do so safely. This can happen when execution is in critical sections of certain built-in routines.
For me, the above makes no sense at all. What does "as soon as it can do safely"? I am not running the code to control an airplane flight full of people here. This is some code running on my PC at home to do some calculation. It can abort right away. It will not hurt me physically or hurt my PC to do so.
So what does "do so safely" actually mean? Safety of what exactly?
Compare the above example to Mathematica where it times out at almost exactly to the requested timeout. Here I ask for 3 seconds timeout
I am not asking for exact timeout. But asking for 1 minute timeout and getting 8 minutes is not good at all.
1.5 minutes is OK. even 2 minutes is OK.
I have more examples to add. But will do that later.
Quick try with Maple 2022 shows timelimit has much improved. Here are 3 examples from above. First one asks for 60 seconds limit, it finishes in 288 seconds. Second one asks for 60 seconds, it finishes in 96 seconds. Third one asks for 60 seconds and finishes in 73 second.
This is much much better than in Maple 2021. Thanks for the Maple engineers who improved this.