Speed ​​Comparison Between Eloquent ORM, Query Builder, and Raw SQL Queries

Does anyone have speed comparison data between Eloquent ORM, Query Builder and Raw SQL Queries? Which is better to choose?

+4
source share
1 answer

Raw SQL will always be the fastest, because a person can always optimize the code and script to his liking. The query constructor (aka Fluent) will be the next fast, only slightly slower than Eloquent. This is because Eloquent uses Fluent internally with its own models and relationships.

If you are looking for pure processing speed, use raw SQL.

Otherwise, use Eloquent for quick development IF you have no models and relationships, and then use Fluent.

+4
source

All Articles