Hi Arwed,
Very interesting post.
I'm not sure I agree with your premise: "Never use the complete
Frameworks".
We use a Framework we've been developing here for a few years and on
average it makes page requests faster, not slower... and I agree
wholeheartedly with datasage too - they can make development a lot
faster and cheaper.
How can frameworks make things faster?
1) Caching. ( Personal choice is xcache for PHP - take a look at
that ). Sure, you can cache without a framework but, at least in our
case, because the framework understands the request, what modules
should be used in the response, the session state etc. etc. it can
intelligently determine whether to leverage the cache to expedite the
response. Caching can include raw chunks of html, sql selects ( that
we compile, so are worth caching ), sql response data, session data
etc.. anything that costs you to produce...
2) Solving common problems. If you're developing everything by hand
you're potentially having to solve the same issues again and again and
you're relying on the person doing that to be able to write fast code
that doesn't memory leak. Abstracting things allows you to leave the
speed and memory consumption in the hands of those who know what
they're doing.
3) Rolling out improvements. If you build lots of sites with the
same framework ( as we do ) then when you make improvements they can
be rolled out under all your sites without having to alter any of the
sites themselves. This is only possible if you've abstracted your
site code from the layer underneath - the framework. Recently we
made a big improvement to our flight-weight data model which sits
underneath most of everything else... we improved both raw-speed and
memory consumption and waste. One set of updates to the servers made
all of our sites a hell of a lot faster without changing any client
code.
Finally, as datasage says above - totally agree that use of Frameworks
can lower the cost to employ people.
There's an interesting interview of the guys at Digg here:
http://boagworld.com/podcast/144-scale
... where they discuss the fact that they employ pretty standard
architectures and frameworks so that they can get lots of cheap,
talented people to build cool stuff without having to spend the first
6 months of a new person's employment training them up.
Your tool sounds very interesting though.
I've two similar PHP5 classes if you're interested;
1: Benchmark: Pretty basic, call from wherever and it builds up a
tree-structure of where you're spending cycles; prints it out as a
little html tree or to error_log
2: Memory: Call from wherever; looks for memory consumption and
catches objects that aren't getting destroyed correctly ( PHP5 still
doesn't destroy circular references properly ( AFAIK ) )
All the best,
Jimbo