You are not logged in.
Pages: 1
I'm testing on converting one of my mORMot 1.18 project to mORMot 2.3.
I was able to get everything to compile after updating uses and a couple data types and method call changes. When I went to run my server application, I thought it was getting into an infinite loop or something, but then I started stepping through the code and I ended up in the ComputeRoutes procedure.
I then just let it run to see what would happen. It took this procedure 13 to 15 minutes to run, on each start up. Once it finished, everything worked as expected.
Looking in this procedure, I see it iterates through a couple for loops. In the upper section were it's working on the for loop for "0 to fModel.TablesMax", it then does another for loop on "0 to high(fPublishedMethods)". It was in this nested for loop that was causing my issue. I commented out this for loop and my server starts up instantly, and everything I use works.
Some information, my Models file has 74 tables in it, and I have 190+ published methods. So, looking at that code, I can somewhat understand why it would take 15 minutes and cause a memory footprint of almost 200MB when running.
I know it's not ideal to comment out that for loop, so I'm posting to see if anyone else had encountered a similar issue and had a better solution.
For reference, the for loop I'm referring to is in \src\rest\mormot.rest.server.pas, Lines 6924-6937 in the release version 2.3
Offline
Oh yes, you are right, it is a O(n*m) loop.
It actually prepares the router to call all published methods for all tables... in the fastest execution time possible.
So it add 14060 nodes for each HTTP method, which are [mGET, mPOST, mPUT, mDELETE] by default. That is, 56240 nodes in your case.
But taking 15 minutes and 200MB, it did not expect it...
I will look into it.
Just out of curiosity: do you use any of the methods against the table? Or are they just published REST methods with no link to tables?
Can you create an issue about it in https://github.com/synopse/mORMot2 ?
I perhaps don't have time to fix it now because I am at https://pascalconference.com/
Offline
Thank you for your quick reply!
All of mine are just published REST methods. I don't have any methods against the tables.
Regards,
Nick
Offline
Can you create an issue about it in https://github.com/synopse/mORMot2 ?
I perhaps don't have time to fix it now because I am at https://pascalconference.com/
Offline
Sure, I'll create a new issue there for this.
I'll copy our messages from here to it.
Regards,
Nick
Offline
Pages: 1