开发者

Is CodeIgniter's ActiveRecord resource intensive?

开发者 https://www.devze.com 2022-12-24 01:44 出处:网络
I’m coding an application with server resources in mind, so I don’t want to use too much so that this application scales in the future. I don’t mind writing my own queries. So, is ActiveRecord re开

I’m coding an application with server resources in mind, so I don’t want to use too much so that this application scales in the future. I don’t mind writing my own queries. So, is ActiveRecord re开发者_开发百科source intensive for my application? Or does it not make a difference?

Thanks!


CI's ActiveRecord is basically not an ActiveRecord, but a Query Builder. It allows you to form simple queries in an object oriented manner. Like with any abstraction, assembling from object state into a SQL query is slower than hardcoding it, but I suspect the performance impact to be negligible.


  • For the basics website(blog) I think CI active records are fine. I think it is always important to have a good database schema(normalize tables).
  • I believe you could view debug information. You should look at the SQL query the module creates and look at the time spent executing query. It is always important to profile your queries. Don't just make assumptions.
  • I think it is more important to have opcode-cache and cache your sql-queries in memory in for example apc/memcached/redis if possible.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号