Welcome Guest, Not a member yet? Register   Sign In
Active record class VS simple query
#7

[eluser]BrianDHall[/eluser]
[quote author="saidai jagan" date="1257259099"]OH. FYI i checked both (get() and query()) methods in the output profiler system.It shows get() is much better than query() :-S .Any information ???[/quote]

I ran some tests on my live server and tested three things:

1- ORM approach (create an object and use get).
2- db->query()
3- db->get()

I found get to be the fastest, query to be .002-.005 seconds slower, and the orm method to be .007 slower.

So the difference in the slowest and the fastest require about 35 queries to cause even a quarter of a second of difference in performance.

Seems kind of a minor difference, but dunno why get() actually runs ever so slightly faster.

For fun I tested $i++ vs ++$i, just cause, and it takes 100,000 uses to score .005 seconds of difference in performance. For those keeping track, that is 5,000,000 increments to be a quarter of a second of difference Smile


Messages In This Thread
Active record class VS simple query - by El Forum - 11-02-2009, 04:56 AM
Active record class VS simple query - by El Forum - 11-02-2009, 05:01 AM
Active record class VS simple query - by El Forum - 11-02-2009, 05:09 AM
Active record class VS simple query - by El Forum - 11-02-2009, 06:23 AM
Active record class VS simple query - by El Forum - 11-02-2009, 09:18 AM
Active record class VS simple query - by El Forum - 11-03-2009, 02:38 AM
Active record class VS simple query - by El Forum - 11-04-2009, 02:07 PM
Active record class VS simple query - by El Forum - 11-04-2009, 10:12 PM
Active record class VS simple query - by El Forum - 11-04-2009, 11:30 PM
Active record class VS simple query - by El Forum - 11-05-2009, 12:07 AM
Active record class VS simple query - by El Forum - 11-05-2009, 08:55 AM
Active record class VS simple query - by El Forum - 11-05-2009, 11:14 AM
Active record class VS simple query - by El Forum - 11-05-2009, 12:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB