Saturday, October 31, 2009

Stunned! In a geek kind of way that is.

Taking a little break in my work today, I did some reading about yet another MVC framework that has exceptional performance yada yada yada. That framework is DooPHP. I'm pretty impressed with the performance actually though this is based on what they stated on their site. I couldn't get it to run on my system!

This prompted me to test against my idea of how an MVC approach should work. I ran apache bench (AB) against a fresh install of Codeignitor 1.7 as well as a local copy of Turbine Dump. I was only slightly surprised to find that the The Dump was a bit slower, but then it's connecting to a DB, performing sessions checking, and all kinds of other mumbo jumbo a completely written and functioning application would.

That said, I copied the app to a different directory and disabled all the bells and whistles. I was still doing all the needed includes, but instantiating nothing other then the base Pavelow factory class as well as the sessions class. Just enough (I felt) to have the Dump kick out a ye ole familiar "Hello World" line.

Benchmark time! I ran ab against each framework for 1000 request and a concurrency level of 5.

Now the good news is that the Harvested Framework I use (that i've been calling Leonidas) had an average test result of 4.20 seconds. Cool! 1000 returns from the site in 4.2 seconds? Yeah, I was feeling good.

Codeignitor (CI) turned out the same test with an average result of 8.58 seconds. Now this really isn't that bad when you consider two things.

1) Turbine Dump / Leonidas is actually a procedural MVC approach that relies on a OO Framework I wrote called Pavelow for it's DB, pagination, and error logging processes. CI OTOH is fully OO. That means a good deal of difference in instantiation overhead alone.

2) CI is about the best performing MVC framework out there with the exception of DooPHP (which or course prompted all of this). Others such as Symfony and Cake are positively behemoths. If you remeber or know what RISC and CISC stand for, Cake and Symfony are clearly CISC frameworks.

Anyway, I decided to start reloading and turning things back on to see how these affected performance. Here goes....

1) Just including Pavelow increased the average of the same test to 7.18 seconds! That's significant overhead for simply loading and parsing the files.

2) Including and instantiating the Pavelow Factory brought the test results up to 7.41 seconds.

2) Now it starts to get ugly! Adding the DB Sessions class alone (but no instantiation) shot the average test result up to 12.65 seconds!!!!! This doesn't even include instantiation. Just parsing overhead! Thankfully, instantiation overhead only resulted in additional 1 second (13.86 to be exact). And thankfully yet again, an op-code cache is going to kill this kind of performance penalty.

To put a point on how significant the penalty of the DB Sessions class is, my inclusion of it is essentially my including just one file. OTOH, when including the Pavelow core, it also includes 7 other classes! That said, the up front penalty of parsing all 8 classes is still far below that of DB Sessions. It really does look like I'm going to have to write a db sessions component into Pavelow.

But all of the above said, I can now see that if I ever formalize Leonidas into a package fit for distribution, it'll stomp the OO frameworks in terms of performance.

Wednesday, October 21, 2009

A Song of Kings

I am I!
Alone in the night time of life
and hurdling forward
faster then all others

I entered alone
and shall die alone
I shall only live once in this earth
and die only once on this earth in this earth
so I shall rule this earth
till the end of this one time.



Monday, October 19, 2009

Business certainly is business

This is a rant about those of you doing web development. In particular those of "US" who code more then we design and like to work with others that do the design part. I'm sure there are a good number of you out there that are aware of what I'm talking. I'm also sure that fewer of you are fully aware to the fullest degree of just how much pain this can entail.

In my particular case, the issue has everything to do with being unequally yoked. LOL. I, the developer code geek type guy (yeah, right) working with someone that is a designer first, and in spite of whatever he claims to be after that, is still a designer. Now that by itself may not be such a bad thing, but we're not talking about "by itself here". We're talking about a semi-official business partnership where the result of our work is money right?

So let me just get straight to the heart of this issue. This guy doesn't know enough about anything to call himself a web developer or web designer. He just isn't . He can make some pretty pictures. I'll certainly give him that, but the buck stops hard right there.

You know what, I'm just just going to create a list of things that suck.


  • Knowing Dreamweaver DOES NOT MAKE YOU A WEB DEVELOPER!!!!!! This is by far the most important thing on this list. Positioning in this case is important.

  • You don't start work until the specs and design are set in stone! Doing otherwise is nothing short of lunacy.

  • The client has no business being able to screw around with stuff while you are building it. None whatsoever. All this does is send the signal to noise ratio through the roof.

  • Nobody works on the code while the developer is building it. Doing so is, yup, you guessed it. Lunacy!

  • Programmers DON'T TASK SWITCH!!!!! Expecting them to do so shows ignorance and a general lack of experience.

  • If you made the design, YOU FIX IT!! Don't expect me or any other programmer that knows better to come back and try to dig through that Dreamweaver crap. It's your creation. Handle it!

  • And don't ever try to tell a programmer how long things should take. For those of you out there that think web sites take two weeks, pull your head out of your arse. It's clear that you don't know enough to realize that you don't know enough. Those sites that have been thrown up in two weeks, all smelly and stuff, are based on huge, slow, kludges called frameworks. Very difficult to extend and they don't scale well. You won't find one site out there that is doing significant traffic and relying on crap like Joomla. And when I say "significant", I'm referring to sites that are running load balanced and fault tolerant clusters.



Moral of the story kids? Always make sure you are dead certain what you're getting in bed with.


Tuesday, October 06, 2009

The sow harvest gap

It certainly is a tough thing when you can see the goodness of things to come, but they aren't coming fast enough to help. I'm in this gap right now. It sucks!

Thursday, October 01, 2009

Juxtapositions

As low so high Elvaleethia
I chatted today with the Dragonfly
and hints of those old things reappeared
Paintings by those azure scopes
That starstruck glance
Those days will not come again
fleeting, watery, and long cherished
The sun caressing us
The ocean soothing us
The sand cradling us