orm
orm copied to clipboard
Improve the performance even more (part 2/3)
Based on this benchmark https://github.com/adrianmiu/forked-php-orm-benchmark the ORM is pretty slow currently compared to competitors.
The reference test:
Current results:
The ideal optimizations based on cached nodes and generated mappers looks like:
Need to abstract Node Parsers into its own factory so:
- They can be cached (the structure does not change between requests)
- They can be generated (to be benched, but in theory, it should produce even better results).
The persist most likely can't be optimized a lot due to the nature of the graph traversal algorithm.
Part 1 of improvement is on its way to be released. The SQL statement cache improves query generation by 25%.
Status: complete.
Part 2: internal Cycle optimizations. Minor improvements in Node parsers and data typecast will lead to 15% performance improvement as the hottest part of the selection.
Status: complete.
Part 3: The command graph can be sorted on relation level, then iterated over the list of object nodes essentially extracting the dependency matrix from the Command itself. It will require graph baking but should significantly increase persist performance and also reduce memory footprint (with active memorization).