I am completely stunned by the performance cost of using ORM/AR, and will be using this to shame our team lead into giving it up and going for raw queries.
We plan a subsequent test, time permitting, that enables caching.
I typically use ORM for about 95% of a project, falling back to a few explicitly native SQL calls when performance can be shown to be a bottleneck in those locations.
php - https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast...
php-raw - https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast...
For "php", they used an ORM. For php-raw they used the stdlib (pdo).
By default, PDO does not do true prepare()s, it just does string interpolation. You need to pass this parameter with the options:
PDO::ATTR_EMULATE_PREPARES => false
And then you'll actually be using MySQL prepared statements. You'll see a noticeable performance improvement for large amounts of queries.