Question: Why does computation slow down in long loops?

I complained about this many times over the years. Maple definitly slows down when running a loop with n problems where n is large. Say over 1000 or 2000.

Breaking the loop into smaller loops and restarting in between each, it is fast. 

I have been seening this for years now. A problem that takes 20 minutes to finish. But after doing restart, it finishes now in 1 minute.

Same exact code.

Only difference is that the first case it is run after long running loop, while in the second case it was run on a fresh engine.

My code does not allocate RAM or do anything fancy with memory. I think it is all due to these remember tables that Maple uses internally, They get clogged down somehow.

I was just now browsing an old Maple answer and question site and found post from August 2001 (yes, 2001, almost 25 years ago) with a person who noticed the same thing.

That is why I changed to use cmaple.exe, and the program will run very fast. But can't not do this in worksheet automatically ofcourse. But in bash script that calls cmaple one time per problem, each time a new engine is used.

The problem with using cmaple.exe, even though it is faster this way,  is that Maple graphics generated are terrible compared to using worksheet driver, so i am forced to use worksheet (different post was made on this with no solution).

So now  in worksheet, I run the loop over 100 iterations. Wait and keep checking when it is done or go take a nap and check again later. 

When that loop is done, click Restart, then Adjust loop counters manualy to do the next 100 problems, and repeate this process.

All manual work. This should not be needed in modern software. May be in 1980 this was needed but not in the year 2025.

I have 92 GB RAM, so memory is not issue. PC is very fast.

I am amazed that Maplesoft have not been able to fix this known problem in Maple for 25 years ago.

What will it take? Wait another 25 years and see if it is fixed? 

Please Wait...