Whew! Just got done writing the latest version of my template rendering engine, and it is a BEAST!
I'm very proud of it, and hopefully with my boss' permission, I will be able to open source it soon. But that's not what my question is about.
The class by itself is a little over 1500 lines of code, but I'm pretty sure that PHP actually ends up executing about 5 or 6 thousand lines of code before the first line of HTML gets output (and all in about a quarter of a second [1/8th after the first execution with Zend Optimizer!]... wow!).
Out of curiosity, though, I'd love to know exactly how many lines of code PHP is executing per execution.
Is there a tool out there that can do this? Preferably for Mac / *n?x platforms.
Thanks for your time.
6 1806
I think I might have found something built into PHP that can do this: http://php.net/declare
Not sure exactly how to make it do what I want it to, but we'll have some fun, I'm sure!
Whew! Just got done writing the latest version of my template rendering engine, and it is a BEAST!
I'm very proud of it, and hopefully with my boss' permission, I will be able to open source it soon. But that's not what my question is about.
The class by itself is a little over 1500 lines of code, but I'm pretty sure that PHP actually ends up executing about 5 or 6 thousand lines of code before the first line of HTML gets output (and all in about a quarter of a second [1/8th after the first execution with Zend Optimizer!]... wow!).
Out of curiosity, though, I'd love to know exactly how many lines of code PHP is executing per execution.
Is there a tool out there that can do this? Preferably for Mac / *n?x platforms.
Thanks for your time.
Nice work pbmods... I remember a big project I worked on when I first started programming PHP, I wrote like 600 lines without ever testing it. I was extatic when it worked the first time! I then realized how stupid that was and vowed never to do that again. Glad to hear about your successful project! Congrats!
Greg
The class by itself is a little over 1500 lines of code, but I'm pretty sure that PHP actually ends up executing about 5 or 6 thousand lines of code before the first line of HTML gets output (and all in about a quarter of a second [1/8th after the first execution with Zend Optimizer!]... wow!).
sounds interesting :-)
but ...
What the zend optimizer is?
regards jx2
Heya, jx2.
Zend Optimizer is a PHP extension that caches opcode and performs runtime optimizations on PHP code. The end result is that after the first execution, each of your scripts executes much more quickly.
You can find out more about this free utility here: http://www.zend.com/products/zend_optimizer
Hehe I just wrote (and re-wrote three times) a template engine. It only handles conditional statements and looping, but that's all I need so far.
I had it output the entire process once and it chains together multiple templates, parsing and injecting and it does a lot more work than I thought it did in such a short time. Like, 3 seconds in all. Tokenization.. Parsing.. Output... 2 - 5 seconds. Yet, I have another script that takes forever just to print <div>s to the browser window. It's 1000 <div>s, but still. It's like, 3 seconds per 100 <div>s.
Looks like something like this should work, except, what it's counting is number of low-level instructions, not necessarily lines. -
function countLine($dump = false)
-
{
-
static $lineCount = 0;
-
-
if($dump)
-
{
-
return $lineCount;
-
}
-
-
++$lineCount;
-
}
-
-
register_tick_function('countLine');
-
declare(ticks = 1);
-
-
.
-
.
-
.
-
-
echo countLine(true), ' lines of code executed.';
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Sticks |
last post by:
ok... im not quite sure how to describe my problem.
i have a php script that runs through my entire php site and writes the
resulting output to html files. this is necessary as the nature of the...
|
by: Russ |
last post by:
I've been trying to get my head around this for 3 days now and it
seems like everything I try does not work for one reason or another.
I built a test page using the TabStrip and MultiPage controls....
|
by: aaa |
last post by:
I fail to see the connection between the code behind and the raw HTML of
the ASPX page how do you get variables and functions to communicate with
each other?
I cannot get this to even fire:...
|
by: Paul |
last post by:
Just wondering if someone could provide an example of passing a variable from
the code behind to javascript in vb. I want to have one control have focus
with the page loading with one condition...
|
by: Cord-Heinrich Pahlmann |
last post by:
Hi,
I'm wondering when php executes the code.
I have a little script which takes around 10 seconds execution time.
In those 10 seconds the script does a lot of mysql_queries and changes
some...
|
by: ckirchho |
last post by:
Hallo,
my task is to establish some kind of full text file search in
Javascript. The files and it's contents are fixed, the HTML/JavaScript
pages lie offline on a server.
As far as Javascript...
|
by: Stef Mientki |
last post by:
hello,
I'm trying to create a high level debugger, based on rpd2.
So when the debugger enters a breakpoint,
I want to display the values of all variables in the, let's say,
5 lines above the...
|
by: mag |
last post by:
I have a make file that executes a perl script that takes PERL as an eval.
The script executes the eval() function via an arguement to the script
like this:
target:
script $(ARGUMENT)
...
|
by: jackson.rayne |
last post by:
Hello,
Another newbie question here.
Let me explain my situation first. I have bought a 3rd party tool
that runs a PHP script and gives me some HTML code which I can
directly use in my...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
|
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...
| |