Welcome Guest, Not a member yet? Register   Sign In
Active Record or not ?
#1

[eluser]Stunt[/eluser]
Hi,
Ever had someone benchmark for Active Records ?
I want to know using ActiveRecord is good choice for big projects or not !
how much diffrent in process and memory usage when we use Active Record in CI project?
#2

[eluser]WanWizard[/eluser]
It depends.

In general, a query is a query, it doesn't really matter how you construct it. Using AR, in absolute figures, is always going to be slower than coding it yourself, due to the object overhead.
But I think the discussion is pointless. Hardware is cheap. From the money I have to pay a highly experienced PHP coder to fix bugs in spaghetti code, or to make modifications into hardcoded queries, I can buy plenty of servers. And don't forget you have to do all the prefixing and escaping by hand.

In terms of memory, there is a different story. The standard CI code loads the entire result set into memory when you fetch the results. This can be quite a problem if the result is large. As most databases have the option to seek in the result set, we use a modified DB_result class that checks if the driver used supports seeks, and if so, doesn't load the entire resultset into memory but uses seek calls to fetch next and previous rows. You will still have the problem when you call result_array(), as that has to fetch all records.
#3

[eluser]Stunt[/eluser]
I think that's right. and thank you for your best help




Theme © iAndrew 2016 - Forum software by © MyBB