Init.php and a Question of Speed

11 posts by 6 authors in: Forums > CMS Builder
Last Post: June 4, 2010   (RSS)

Re: [Perchpole] Init.php and a Question of Speed

By aev - May 31, 2010

We use the same method you describe here. We haven't noticed any performance problems on the sites we build, but they all have less than 100 pages each.

-aev-

Re: [Perchpole] Init.php and a Question of Speed

By Donna - May 31, 2010

Hey Perch!

Nope, no problem doing that at all -- in fact, we often setup something exactly like that in the sites we create -- our listing/realty/auto templates all use a separate init file just to simplify things a bit. :)
Donna

--
support@interactivetools.com

Re: [Donna] Init.php and a Question of Speed

By Perchpole - May 31, 2010

Hi, Folks -

Thanks for your response. From what you tell me it seems I can breath a little easier!

However, in terms of the wider debate, and best practise, I assume there are certain things we should bear in mind to avoid putting uneccesary strain on a server.

For example, I've heard that too many foreach loops can make things slow down considerably.

:o/

Perch

Re: [Perchpole] Init.php and a Question of Speed

By Jason - June 2, 2010

Hi Perch,

Yes, foreach loops can slow down the server, but you probably wouldn't notice any change in performance unless you are looping through quite a large number of records. .

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Perchpole] Init.php and a Question of Speed

By Djulia - June 3, 2010

Hi,

I use sometimes this site to obtain information :
http://www.phpbench.com/

Djulia

Re: [Djulia] Init.php and a Question of Speed

By Perchpole - June 3, 2010

Hi, Folks -

Again, thanks for your feedback. I have noticed one of my sites appears to stutter as it loads a menu file - which is crowded with foreach loops.

Like many people (I suspect), I simply have no idea what represents "best practise" when it comes to lean and efficient php code for CMSB. That's one of the reasons why I started this debate. Any more efficiency tips would be most welcome.

:0s

Perchpole

Re: [Perchpole] Init.php and a Question of Speed

By Djulia - June 3, 2010

Hi,

You can cache [font "Verdana"]foreach loops in files on your server.

Djulia

Re: [Djulia] Init.php and a Question of Speed

By Perchpole - June 3, 2010

Sounds good.

Plz tell me more!

:0)

Perch

Re: [Perchpole] Init.php and a Question of Speed

By Djulia - June 3, 2010

I use this class:
http://codecanyon.net/item/caching-class/69006

That should help you!

Djulia