Tuesday, September 30, 2008

FireSymfony - A Firebug extension for symfony

While developing websites is nice to have at hand the right tools to do the job effectively. One of the tools I like the most is Firebug for all it’s debugging capabilities. Also, because I develop websites using symfony, the web debug toolbar provided by the framework is very handy to know what was happening in the server while the request was processed.


But sometimes the toolbar position makes impossible to use some features of the layout of our website, like a link menu on the top right corner. It also happens that while we display a small popup with the resize functionality disabled it’s turns hard to access all the data displayed by the toolbar.


The solution I’ve came up with is to move all the data from the toolbar to Firebug, actually, to port the symfony web debug toolbar as a Firebug extension. This will remove the toolbar from the page html and will show it in a convenient place that almost every web developer is used to.


Taking advantage from the cool new features of symfony 1.2 I started a project to develop a symfony plugin to send the data to the Firebug extension. The later has been smartly called FireSymfony.


The roadmap I'm following is the next one:

  1. Extend the sfWebDebug class and it’s panels to send JSON data to the browser and not html markup. (Thanks to the neat code design of symfony this task has been really easy).
  2. Create the extension layout inside Firebug to present the same functionality provided by the web debug toolbar.
  3. Add some CSS styles to make it look pretty.


Currently I’m finishing the second step and the idea is to release both the symfony plugin and the Firebug extension during october, so stay tuned.


Below I added a screenshot of the current state of the project. Please provide feedback about the idea so I can try to make it better and useful for everyone. 






 


Tuesday, September 2, 2008

We started something!!

It seems that our benchmarking example has pushed people to do their useful benchmarks. 
You can check this framework benchmarks page and try to guess what are they actually benchmarking. If you can find the point of that benchmark, please drop some comments here, because I want to sleep with ease tonight.

So I want to left here a just a few remarks about this kind of stuff:
  1. Stop benchmarking your just created framework against symfony, Zend Framework, Cake, or whatever.
  2. When are we going to realize that the point of a framework is not to run as fast as assembly code, but to improve developer productivity and save money in developer time?
  3. I'm not pissed off, I just can't get the point of those benchmarks.  
If you have more examples of this kind of useless benchmarks, please add them to the comments.

Monday, September 1, 2008

Benchmarking die("Hello world!"); VS. exit("Hello world!"); VS. echo "Hello World!"; on PHP

After doing some useful and problem solving benchmarking with Siege we can scream to every corner of the world that exit() is faster than die() and echo

Show me the facts! I hear you screaming. Let there be facts!:

echo "Hello world!";
Transactions:         250 hits
Availability:      100.00 %
Elapsed time:        7.10 secs
Data transferred:        0.00 MB
Response time:        0.01 secs
Transaction rate:       35.21 trans/sec
Throughput:        0.00 MB/sec
Concurrency:        0.20
Successful transactions:         250
Failed transactions:           0
Longest transaction:        0.05
Shortest transaction:        0.00


die "Hello world!";
Transactions:         250 hits
Availability:      100.00 %
Elapsed time:       10.04 secs
Data transferred:        0.00 MB
Response time:        0.01 secs
Transaction rate:       24.90 trans/sec
Throughput:        0.00 MB/sec
Concurrency:        0.17
Successful transactions:         250
Failed transactions:           0
Longest transaction:        0.04
Shortest transaction:        0.00


exit "Hello world!";
Transactions:         250 hits
Availability:      100.00 %
Elapsed time:        6.05 secs
Data transferred:        0.00 MB
Response time:        0.01 secs
Transaction rate:       41.32 trans/sec
Throughput:        0.00 MB/sec
Concurrency:        0.27
Successful transactions:         250
Failed transactions:           0
Longest transaction:        0.04
Shortest transaction:        0.00


The previous test were performed simulating 25 concurrent users with a 10 times repetition. Now just imagine for one minute (or two if you need more) if 20.000 concurrent users hits your echo "Hello World" website! That will be a mess! Just by imagine myself this scenario I can't stop hearing the sirens on my mind, so please, grep through your code and preg_replace() all those echo "Hello world!" you may have there!