Making PHP Scripts Faster and Less Demanding

What are your ways to making the scripts faster and easier on the serv

Page 1 of 1

3 Replies - 727 Views - Last Post: 11 January 2010 - 02:39 PM Rate Topic: -----

#1 Cbeppe  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 31
  • View blog
  • Posts: 215
  • Joined: 16-September 09

Making PHP Scripts Faster and Less Demanding

Posted 10 January 2010 - 12:34 PM

Hey all!

I've been searching around the web for ways to make PHP Scripts run faster with less strain on the server. Unfortunately, good advice is not always easy to find and many tips are contradicting. Some say echo() is slow, others say to just use single quotes... What's right in your opinion and/or experience? Are there any definite do s or don't s?


Thanks for sharing.
Is This A Good Question/Topic? 0
  • +

Replies To: Making PHP Scripts Faster and Less Demanding

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6107
  • View blog
  • Posts: 23,661
  • Joined: 23-August 08

Re: Making PHP Scripts Faster and Less Demanding

Posted 10 January 2010 - 09:05 PM

echo, single quotes, etc...not a big deal in the greater scheme of things. You're talking about premature optimization for the most part.

Bad database design, inefficient queries, lack of and/or improper database indexes...those are the things that bring a server down under load.
Was This Post Helpful? 0
  • +
  • -

#3 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3099
  • View blog
  • Posts: 10,887
  • Joined: 08-August 08

Re: Making PHP Scripts Faster and Less Demanding

Posted 11 January 2010 - 06:00 AM

I agree with Jack, but would add: Structure your code. If you write code that takes 100 lines to do what could be done in less than 50, your code will take roughly twice as long to run. Code with little or no structure tends to grow in size and complexity, making it harder to debug/change as well as slow when running.
Was This Post Helpful? 0
  • +
  • -

#4 Cbeppe  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 31
  • View blog
  • Posts: 215
  • Joined: 16-September 09

Re: Making PHP Scripts Faster and Less Demanding

Posted 11 January 2010 - 02:39 PM

Sounds like some basic, solid tips.

Thanks a lot.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1