orm icon indicating copy to clipboard operation
orm copied to clipboard

Improve the performance even more (part 2/3)

Open wolfy-j opened this issue 5 years ago • 3 comments

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: Screenshot_136

The ideal optimizations based on cached nodes and generated mappers looks like: Screenshot_69

Need to abstract Node Parsers into its own factory so:

  1. They can be cached (the structure does not change between requests)
  2. 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.

wolfy-j avatar Dec 26 '19 18:12 wolfy-j

Part 1 of improvement is on its way to be released. The SQL statement cache improves query generation by 25%.

Status: complete.

wolfy-j avatar Jan 12 '20 15:01 wolfy-j

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.

wolfy-j avatar Jan 13 '20 13:01 wolfy-j

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).

wolfy-j avatar Apr 07 '21 19:04 wolfy-j