473,399 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

performance hit with OOP?

I found myself writing the following comment in the overall
constructor comment for the class McLoops. And when I got done writing
this comment, I began to wonder, damn, at what point does the
performance hit become too expensive to scale? Does anyone have any
stats on this? How many calls to a database can you have on one page
before that page becomes painfully slow? How many hits does it take to
slow a plain html file versus a simply included() PHP file versus a
system like Smarty? How many lines of code does Phorum execute to
render a forum with 200 entries in it?

Does anyone know where such statistics can be found?

* It's worth noting where McLoops fits into the picture. Please
consider the complete history
* of a single function: showLinkArea(). These are the events:
*
* 01. showLinkArea() is encountered in a template and executed
* 02. showLinkArea() sends McControllerForAll the string
"showLinkArea"
* 03. McControllerForAll sends "showLinkArea" to McRunCommand
* 04. McRunCommand calls up CommandShowLinkArea and calls test()
* 05. If test() returns true then McRunCommand calls the
command() method of CommandShowLinkArea
* 06. CommandShowLinkArea calls for an arrangement called
"showLinkArea"
* 07. showLinkArea.php, the arragement, in default form calls
elementsPublicListAllForLinkArea()
* 08. elementsPublicListAllForLinkArea(), calls up McLoops and
runs through it.
* 09. elementsPublicListAllForLinkArea(), sets "SeekArrangement"
as the action object for McLoop
* 10. McLoops loads ActionsSeekArrangement and calls its 4 action
methods
* 11. ActionsSeekArrangement loads many arrangments to output the
various aspects of the link area
* 12. ActionsSeekArrangement, by calling other arrangements,
probably causes dozens of element() functions to be called.
* 13. Those element() functions in turn call many other objects.

Mind you, this is one function. There might be 20 functions in a
template. Or more.
Jul 17 '05 #1
1 1722
lawrence wrote:
I found myself writing the following comment in the overall
constructor comment for the class McLoops. And when I got done writing
this comment, I began to wonder, damn, at what point does the
performance hit become too expensive to scale? Does anyone have any
stats on this? How many calls to a database can you have on one page
before that page becomes painfully slow? How many hits does it take to
slow a plain html file versus a simply included() PHP file versus a
system like Smarty? How many lines of code does Phorum execute to
render a forum with 200 entries in it?

Does anyone know where such statistics can be found?

* It's worth noting where McLoops fits into the picture. Please
consider the complete history
* of a single function: showLinkArea(). These are the events:
*
* 01. showLinkArea() is encountered in a template and executed
* 02. showLinkArea() sends McControllerForAll the string
"showLinkArea"
* 03. McControllerForAll sends "showLinkArea" to McRunCommand
* 04. McRunCommand calls up CommandShowLinkArea and calls test()
* 05. If test() returns true then McRunCommand calls the
command() method of CommandShowLinkArea
* 06. CommandShowLinkArea calls for an arrangement called
"showLinkArea"
* 07. showLinkArea.php, the arragement, in default form calls
elementsPublicListAllForLinkArea()
* 08. elementsPublicListAllForLinkArea(), calls up McLoops and
runs through it.
* 09. elementsPublicListAllForLinkArea(), sets "SeekArrangement"
as the action object for McLoop
* 10. McLoops loads ActionsSeekArrangement and calls its 4 action
methods
* 11. ActionsSeekArrangement loads many arrangments to output the
various aspects of the link area
* 12. ActionsSeekArrangement, by calling other arrangements,
probably causes dozens of element() functions to be called.
* 13. Those element() functions in turn call many other objects.

Mind you, this is one function. There might be 20 functions in a
template. Or more.


OOP performance in PHP4 varies across the board. Depending on how you
architect your application, your mileage may vary. Having a
multi-processor server with oodles of RAM helps a lot. Generally
speaking, the rule of thumb for PHP4 is that an app that leans towards
the OO paradigm will be slower when compared to an app designed to be
procedural in nature.

Amir.

--
Rules are written for those who lack the ability to truly reason, But for
those who can, the rules become nothing more than guidelines, And live
their lives governed not by rules but by reason.
- James McGuigan
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Brian Patterson | last post by:
I have noticed in the book of words that hasattr works by calling getattr and raising an exception if no such attribute exists. If I need the value in any case, am I better off using getattr...
12
by: Fred | last post by:
Has anyone a link or any information comparing c and c++ as far as execution speed is concerned? Signal Processing algorithms would be welcome... Thanks Fred
12
by: serge | last post by:
I have an SP that is big, huge, 700-800 lines. I am not an expert but I need to figure out every possible way that I can improve the performance speed of this SP. In the next couple of weeks I...
6
by: teedilo | last post by:
We have an application with a SQL Server 2000 back end that is fairly database intensive -- lots of fairly frequent queries, inserts, updates -- the gamut. The application does not make use of...
5
by: Scott | last post by:
I have a customer that had developed an Access97 application to track their business information. The application grew significantly and they used the Upsizing Wizard to move the tables to SQL...
115
by: Mark Shelor | last post by:
I've encountered a troublesome inconsistency in the C-language Perl extension I've written for CPAN (Digest::SHA). The problem involves the use of a static array within a performance-critical...
13
by: bjarne | last post by:
Willy Denoyette wrote; > ... it > was not the intention of StrousTrup to the achieve the level of efficiency > of C when he invented C++, ... Ahmmm. It was my aim to match the performance...
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
7
by: Michael D. Ober | last post by:
When calling Enqueue, the internal array may need to be reallocated. My question is by how much? In the old MFC array classes, you could tell MFC how many additional elements to add to the array...
1
by: jvn | last post by:
I am experiencing a particular problem with performance counters. I have created a set of classes, that uses System.Diagnostics.PerformanceCounter to increment custom performance counters (using...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.