He picked up the speed from the ORM?

Have heard many times the assertion that any SQL ORM turns into SQLLite i.e. lost the ability to use a pile of chips most DBMS. Is it really so? How much it affects the performance?
September 19th 19 at 00:12
6 answers
September 19th 19 at 00:14
Yes, the speed drops if you use everywhere. Because each entry is initialized to a fat class.
And how many drops? Interest, ten percent? Times? - jovanny72 commented on September 19th 19 at 00:17
: Here it is necessary to start from concrete rather than abstract ORM. For example I had to work with the port Sprig for PHP to Kohana. Where each each entry is initialized in the classrooms to the fields. Plus magic Get/Set. Plus related records. And in the end was the score at times. - hipolito_Trantow20 commented on September 19th 19 at 00:20
you probably about ActiveRecord. For example in Doctrine at each entry triggers a small harmless object. Just fields and methods. - lucas.Sau commented on September 19th 19 at 00:23
: I it to what - if you are not lucky enough to work with under-ORM in PHP which is enough - no need to Hait all and think they all work the same. - lucas.Sau commented on September 19th 19 at 00:26
: Yes, this is ActiveRecord (on Data Mapper, it is clear this is not a problem). ORM of this type is most common (could be wrong). I did not hail, but only gave an example. - hipolito_Trantow20 commented on September 19th 19 at 00:29
September 19th 19 at 00:16
Depends on the ORM. Overhead performance of course, especially if you take stucci type Doctrine with hydrazine, etc. But the profit in terms of development time and product quality which they give Slavoj pay for all costs. If the project becomes popular and +30% is the extra rack of servers, that is to pay for the server already becoming more expensive than the developer, then it makes sense to refactor and optimize bottlenecks. But premature optimization is evil.

That to SQL and database features - Doctrine and many others allow you to use as native queries (its hydration) and to add some functions to *QL. So many things can decently accelerate (the doctrine of the bottleneck is a unit-of-work but rather the calculation of DIFA data which they revolve. By default, it compares all in the forehead, like dirty checking, but you can set your implementation for your entities if you want it).
September 19th 19 at 00:18
no, not turning into sqllite
you can use portable features
the speed drops because the ORM doesn't know how to smoothly translate your complex queries in the optimal DBMS
+ many requests simply cannot be implemented in a DBMS
+ features specific to the DBMS in Ormes't sausages
not quite understand, could you explain - janis_Schneider commented on September 19th 19 at 00:57
: well fuck you ORM if you already have a specific database - jovanny72 commented on September 19th 19 at 01:00
+ many requests simply cannot be implemented in a DBMS

Oh! :-) - jovanny72 commented on September 19th 19 at 00:21
: well, I think everyone understood what I'm talking about the ORM. - hipolito_Trantow20 commented on September 19th 19 at 00:24
"features characteristic only for the given DBMS in Ormes't sausages"
So DBMS as I understand it and distinguish these same features. Here for example: "mysql update on duplicate" how will using ORM to work with? - lucas.Sau commented on September 19th 19 at 00:27
enter in the desired ORM and look in the documentation what are the limitations
I don't really know why sane developer to use the mysql update on duplicate
if you are a pervert then the answer is ORM is not for you - lucas.Sau commented on September 19th 19 at 00:30
: nothing is impossible, would be the correct code :-) - hipolito_Trantow20 commented on September 19th 19 at 00:33
: ranged I just rewrite the code and queries for programmers and feel the Bedouin is one of those. - rene_Mohr commented on September 19th 19 at 00:36
: what's wrong with the "update on duplicate"? - janis_Schneider commented on September 19th 19 at 00:39
: well, tell us what logic you want it to lay where it normally should be used? - jovanny72 commented on September 19th 19 at 00:42
: well, I take the data from the server. "date and data". Often the data for the last day may be adjusted ie to change (be refined). Without "on duplicate update" do? - janis_Schneider commented on September 19th 19 at 00:45
: a foot here ORM dragged? - rene_Mohr commented on September 19th 19 at 00:48
: well, if I app I will write using the ORM, how do I implement this feature? ORM is still not really enjoyed. - janis_Schneider commented on September 19th 19 at 00:51
: most likely he is there and not do anything well or standard thrown out exasan and you will simply handle - jovanny72 commented on September 19th 19 at 00:54
September 19th 19 at 00:20
Like any code, ORM carries a logic. The execution of this logic eats memory and CPU time. Failure is not (always FOR).
The question is - but do you write those tasks for which they are going to use ORM, is also optimal, as it is written in the well-known ORM? Maybe ORM is not needed in this case and You can do direct communication with the driver DBMS (times doubted the feasibility of the use).

And here correctly noted, modern ORM can fine-tune, so if You have a large project, such libraries will help You cool.
September 19th 19 at 00:22
He picked up the speed from the ORM?

the application speed can fall, but also depends on how your code is written without an ORM.

He picked up the speed from the ORM?

no. the speed of development can greatly increase if to be able to work with her.

my personal opinion if the project was not originally hayload better ORM. the speed is greatly increased razarbotka + code becomes much easier to develop and refactor. fewer errors, more reliability, no headaches when you need something refactorit project razivaetsya easily. if the load increases, there's a lot of opportunities for optimization.

often if the load is more on reading it is necessary to cache + in narrow places where you only want to show something, you can do direct queries to the database without the ORM. but mPas only be used to change objects.

a good ORM does not bind the hands and have the ability for fine work at a lower level.

I use a couple of years doctrine2 for php, although for many years wrote the queries by hand. reluctant to return, although it can.
September 19th 19 at 00:24
Of course dropping. But it all depends on the ORM.
If performance is important, then the best way is to use a microORM such as Dapper or PetaPOCO. In fact, they only allow you to query and quickly mappit objects. Dapper good at it. The StackOverflow website is fully working on it. But in this case no buns "big" ORM like support for state and LINQ-to-SQL.

Find more questions by tags ORMSQL