Click here to Skip to main content
Click here to Skip to main content
Technical Blog

Tagged as

CakePHP 2.0 Rant Retraction

, 23 May 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
CakePHP 2.0 rant retraction


In yesterday's article, it appears I may have misunderstood something regarding lazy loading. I incorrectly read it as "loading the data" on-demand opposed to loading the object on-demand. This actually looks like a great feature, especially after reading this.

It appears that the associated models would automatically be loaded simply because they are related to the model you are querying, even if you are not retrieving data from it.

Thanks for the clarification on lazy loading Jose and I'm actually quite excited to see this change after further research into the situation. Check out the following benchmarks from the above mentioned article.

Before Lazy Loading

  • Total Requests made: 100
  • Total Time elapsed: 6.8480186462402 (seconds)
  • Requests/Second: 14.603 req/sec
  • Average request time: 0.068 seconds
  • Standard deviation of average request time: 0.002
  • Longest/shortest request: 0.078 sec/0.066 sec
  • Memory usage: 9.75MB

Post Lazy Loading

  • Total Requests made: 100
  • Total Time elapsed: 4.8957378864288 (seconds)
  • Requests/Second: 20.426 req/sec
  • Average request time: 0.049 seconds
  • Standard deviation of average request time: 0.001
  • Longest/shortest request: 0.056 sec/0.048 sec
  • Memory usage: 7.25MB

Almost 6 full requests more per second! Just in the 100 requests made, there is over 2 seconds being gained! Excellent work community!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Jamie Munro

Canada Canada
I am the author of three books: 20 Recipes for Programming PhoneGap, 20 Recipes for Programming MVC 3, and Rapid Application Development with CakePHP.
I enjoy reading and writing and I like to blog as much as I can on my personal blog EndYourIf.
I'm a father of three kids, twins (boy and a girl) and another baby girl.
Follow on   Twitter

Comments and Discussions

QuestionIt takes a big man to admit when he's wrong... PinmemberJohnny J.23-May-13 20:43 
...It takes an even bigger man to not punch the person who exposes him straight in the face... Laugh | :laugh:
Why can't I be applicable like John? - Me, April 2011
Beidh ceol, caint agus craic againn - Seán Bán Breathnach
Da mihi sis crustum Etruscum cum omnibus in eo!
Just because a thing is new don’t mean that it’s better - Will Rogers, September 4, 1932

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150302.1 | Last Updated 23 May 2013
Article Copyright 2013 by Jamie Munro
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid