A
A
AlpineMilk2021-04-30 19:58:32
Doctrine ORM
AlpineMilk, 2021-04-30 19:58:32

Whether to give the list of objects through Doctine or through Dbal in the form of arrays?

Hello everyone, I have a question:
I have already seen and read several times that in order to send a list of goods, for example, it is better not to use the doctrine, but to do it through bare sql or dbal and, for convenience, at the php level, write these arrays into dto.
But it’s already suitable for recording.
And I ran tests for getting data from the database:

Количество записей - 91771
Doctrine - 18.45s, 18.29s, 18.10s, 18.22s     В виде объектов
DBAL - 15.84s, 16.98s, 15.58s, 16.11s  В виде массива
Просто PDO - 15.34s, 16.24s, 15.07s, 16.59s  В виде массива

But this is not taking into account the time it takes to enumerate these records into dto objects for pdo and dbal.
Here you can see that the difference is not significant, especially since these are 90k records, which, for example, will not be on the site, they are usually thrown out in pieces using pagination
. The project is an API that will return data (not 90k, but for example 300).

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question