Production Split performance

Hi,
I want to install the production_split module but I’m facing a performance issue, after testing the module in the demo, it worked fine, but then on my server productions with quantity >= 50 (aprox) takes more than 2 minutes, after debugging, I see that this loop is taking +90% of the time:

but again, no problems in the demo, I don’t have the copy function overwritten anywhere, I tried to find a recent commit that could’ve fixed this but I didn’t find anything.
Also I’ve tried to modify the loop to copy all the productions in once at the end and the execution times drops from a few minutes to a few seconds, but I don’t know if it could be a valid improvement as it does not seems like a general issue.
Any ideas? thanks in advance.

Indeed it was not expected to have so much loop when designed.
But for sure it will be a good improvement to avoid the ModelStorage.copy in the loop.

Fine, I’ve created: Avoid ModelStorage.copy inside Production.split loop (#14325) · Issues · Tryton / Tryton · GitLab