Ivan Bogomolov2014-05-26 18:08:04
Ivan Bogomolov, 2014-05-26 18:08:04

Anyone gone with doctrine2?

Every day I realize that orm doctrine2 is destroying website performance.
A possible reason is poor link architecture (there are too many of them).
I also checked the usual pdo mysql query for a selection of 100 elements takes 0.2 MB of memory, and the doctrine of as many as 3 or even 4 MB. The difference of 15 times did not scare me before, but I often notice memory allocate errors, and also php works with memory_limit = -1 . Is this normal? At the same time, viewing a page with about 25-30 requests causes a 20% load per request. There is a premonition that with 3000 simultaneous uniques, the site will fall and not return.
So, did anyone have such problems, did anyone abandon the doctrine and write natively, or did they somehow optimize the database, or did they go to another form, active record?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
Sergey, 2014-05-26

Hiload and all sorts of doctrine ORM things are not compatible.
Fast to develop - yes Doctrine is good. But personally, I never understood why this heaviness in a php site.
For fast execution - you yourself need to know and represent all the connections in your system. No universal ORM will help you. Only his own, only hardcore.

OnYourLips, 2014-05-26

There are no analogues if the Data Mapper implementation is required.
If ActiveRecord is needed, then I would advise Eloquent (IMHO propel is too old).
However, Doctrine has no performance issues: DQL is actually SQL, and if you have a problem with a query, then only you are to blame.
Using ORM, you must know in advance what kind of request you will end up with.

Andrey Kulikovsky, 2014-05-27

About memory, for fetches at the front, call the scalar result getScalarResult (stupidly an array or do dto if beautiful objects are needed), Proxy entity objects are quite heavy.
Proxy objects are best used for the backend (user accounts, admin panel, and other management).

Pavel Solovyov, 2014-05-26

yes, on propel orm

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question