473,473 Members | 1,475 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Performance comparisons?

Has anyone done any performance comparisons between what one might
call the 'program' vs 'interjection' models?

What I'm calling the 'program' model is putting a '<?php' invocation
at the top of the page, a '?>' exit at the bottom, and doing all the
html output via echo statements.

The 'interjection' model, in contrast, repeatedly invokes php for
minimal periods instead, so instead of one mass of php code, the same
amount of code is in smaller pieces and laced in and out of the html.

The interpreter must look at everything regardless, but I'm wondering
whether there's significantly more overhead one way than the other.
From the fact that 'echo' isn't actually a function, my guess is that
the overhead might be a wash, but does anyone know of any actual
performance tests?

Margaret
--
(To mail me, please change .not.invalid to .net, first.
Apologies for the inconvenience.)
Jul 17 '05 #1
2 1335
Hi Margaret,

On Wed, 24 Mar 2004 18:19:43 GMT, Margaret MacDonald
<sc**********@att.not.invalid> wrote:
Has anyone done any performance comparisons between what one might
call the 'program' vs 'interjection' models?

What I'm calling the 'program' model is putting a '<?php' invocation
at the top of the page, a '?>' exit at the bottom, and doing all the
html output via echo statements.

The 'interjection' model, in contrast, repeatedly invokes php for
minimal periods instead, so instead of one mass of php code, the same
amount of code is in smaller pieces and laced in and out of the html.

The interpreter must look at everything regardless, but I'm wondering
whether there's significantly more overhead one way than the other.
From the fact that 'echo' isn't actually a function, my guess is that
the overhead might be a wash, but does anyone know of any actual
performance tests?


I believe the performance difference is minimal in comparison to
database accesses. But with your 'program' model its impossible to
change the HTML code.

HTH, Jochen
--
Jochen Daum - Cabletalk Group Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #2
Uzytkownik "Margaret MacDonald" <sc**********@att.not.invalid> napisal w
wiadomosci news:rl********************************@4ax.com...
The interpreter must look at everything regardless, but I'm wondering
whether there's significantly more overhead one way than the other.
From the fact that 'echo' isn't actually a function, my guess is that
the overhead might be a wash, but does anyone know of any actual
performance tests?


My guess is that injection wins by a whisker, since there's less to parse
and fewer opcodes.
Jul 17 '05 #3

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

Similar topics

8
by: Sebastian Werner | last post by:
Howdy, I currently develop the javascript toolkit qooxdoo (http://qooxdoo.sourceforge.net), some of you heard it already. We have discovered a slowdown on Internet Explorers performance when...
1
by: Johann Uhrmann | last post by:
Hello, are there any experiences about the performance of indices with different data types. How do the performance of an index that consists of - an integer field - a varchar() field - a...
26
by: pembed2003 | last post by:
Hi, I have an application where I use the strncmp function extensively to compare 2 string to see if they are the same or not. Does anyone know a faster replacement for strncmp? I notice there is...
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...
37
by: jortizclaver | last post by:
Hi, I'm about to develop a new framework for my corporative applications and my first decision point is what kind of strings to use: std::string or classical C char*. Performance in my system...
12
by: Lars Schouw | last post by:
All, Does anyone know how much performance speedup I can expect by using 64 bit C++ / Windows XP 64 bit over the 32 bit versions? Did anyone test this under Visual Studio 2005 or Intel C++...
48
by: Alex Chudnovsky | last post by:
I have come across with what appears to be a significant performance bug in ..NET 2.0 ArrayList.Sort method when compared with Array.Sort on the same data. Same data on the same CPU gets sorted a...
22
by: Jon Harrop | last post by:
Flying Frog just launched the OCaml Journal: http://www.ffconsultancy.com/products/ocaml_journal/free/introduction.html?clcpp The free first article covers the basics of the OCaml programming...
7
by: jehugaleahsa | last post by:
I wrote a simple method that allows me to pass a delegate to find a value in a list. I already had a set of methods for doing comparisons: less, greater, equal, equivalent, etc. However, find...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.