You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I tested the memory usage of the DB Mappers of F3 with different actions.
I noticed that the load method needs almost as much memory as the find method. The cause is that a load use the find method and saves an array of all mapped records in the memory. This leads to a high memory usage if I have to process very much records. Of curse, I could use the paginate method, but this is not a very good choice because of complicated usage of loops.
Because of this, I have a suggestion. The load method shouldn't use the find method anymore. I recommend to store only the results of the internal select method before it calls the factory method to convert the results to new mapper objects.
With every call to next() or skip(), the next item of the results array should be processed in the factory method. This would considerable reduce the memory usage.
I hope this was understandable.
Greetings
The text was updated successfully, but these errors were encountered:
Hi, yes it's understandable and I also noticed this already. To change this however, I'm not sure if it would be a breaking change, as we probably would refactor usage of the protected $query property, and I know from people that they're misusing it. So I'd like to improve this, but perhaps move that to v4. And yes, I know v4 is more a less becoming a legend, but I think we'll have plenty of time this winter to finally do the jump ;)
Hello,
I tested the memory usage of the DB Mappers of F3 with different actions.
I noticed that the load method needs almost as much memory as the find method. The cause is that a load use the find method and saves an array of all mapped records in the memory. This leads to a high memory usage if I have to process very much records. Of curse, I could use the paginate method, but this is not a very good choice because of complicated usage of loops.
Because of this, I have a suggestion. The load method shouldn't use the find method anymore. I recommend to store only the results of the internal select method before it calls the factory method to convert the results to new mapper objects.
With every call to next() or skip(), the next item of the results array should be processed in the factory method. This would considerable reduce the memory usage.
I hope this was understandable.
Greetings
The text was updated successfully, but these errors were encountered: