LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-20-2007, 12:35 PM   #1
simopal6
Member
 
Registered: Jun 2006
Location: Italy
Distribution: Slackware 13.1
Posts: 230

Rep: Reputation: 30
Does OOP make PHP slower?


Hello!
I've been programming in PHP for some years, and i almost immediately began using classes because i like OOP. Now i'm asking this question: does using many classes make execution slower? I think it does, but i wonder if the waste of time is considerable.
Do you know?
Thanks
 
Old 04-20-2007, 06:41 PM   #2
AdaHacker
Member
 
Registered: Oct 2001
Location: Brockport, NY
Distribution: Kubuntu
Posts: 384

Rep: Reputation: 32
Short answer: yes. According to this link, method calls on objects are about twice as slow as normal function calls. However, that's a few years old, so things may have improved since then. I don't know if that qualifies as "considerable," but it's not insignificant. Though I don't think it's enough to abandon OOP.
 
Old 04-20-2007, 10:13 PM   #3
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
I find the things that really slow down PHP scripts aren't function calls and what not, but disk and database access. I wouldn't worry about it. Plus, OO code is so much easier to build and modify.

Last edited by 95se; 04-20-2007 at 10:15 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OOP in PHP patpawlowski Programming 5 11-20-2005 04:37 PM
OOP (PHP) classes and extended classes ldp Programming 3 03-05-2005 11:45 AM
Why is Mandrake/KDE getting slower and slower? KWTm Mandriva 12 09-28-2004 09:43 PM
Internet connection becomes slower and slower. caesius_01 Linux - General 1 03-14-2004 02:59 PM
idebus=66 in my lilo.conf (does that make my comp slower?) h1tman Linux - Hardware 1 09-18-2003 12:51 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration