About YAML + Phocoa runtime

0 views
Skip to first unread message

Errol Sayre

unread,
Jan 17, 2008, 9:32:22 AM1/17/08
to phocoa users
From Alan's comments on my workspace setup post, it reminded me of one
concern I have with Phocoa.

Does all the YAML configuration of data get read EVERY time a page
request comes in or is there an optimized PHP build of the system to
upload to your production server?

Alan Pinstein

unread,
Jan 17, 2008, 9:42:41 AM1/17/08
to phocoa...@googlegroups.com
At the moment, the YAML is parsed on every request. If you install
SYCK via pecl as the YAML parser, it's a negligible amount of time.
Under a few ms or less. I haven't tested the speed of Horde/YAML yet.

It is possible that I could implement optional parsed YAML caching
with memcache or something like that, but YAML parsing isn't close to
being a bottleneck of any phocoa app I've built yet.

Alan

Errol Sayre

unread,
Jan 17, 2008, 10:53:49 AM1/17/08
to phocoa users
Very cool.

As I said, I'm new to frameworks and since I've always built my stuff
"by hand" I'm a little wary of introducing lots of overhead that I'm
not really sure what/how it works... yet I want to not have to :-)

Alan Pinstein

unread,
Jan 17, 2008, 11:16:44 AM1/17/08
to phocoa...@googlegroups.com
I hear ya. I am an optimization freak. My first real programming
environment was on the Palm OS, which at the time had a 12k heap, a
2k stack, and an 8Mhz processor. It was easy to make things really slow!

So I try very hard to make sure that phocoa doesn't introduce
unreasonable overhead. So far it's been good.

I have been using PHP for about 10 years and am quite experienced in
its performance characteristics, and I try to code phocoa as much as
possible using the techniques I've learned for keeping speed up, but
without sacrificing the architectural integrity of the framework. If
I really wanted to go for speed, I would have had to architect the
framework a little differently. I use a lot of reflection techniques
in phocoa to implement all of the delegation, which is more expensive
than calling things directly. However, an average web page will make
only HUNDREDS of these calls that are all in the sub-ms range, so
while on a nominal basis, they're slower, they don't really cause a
noticeable difference in performance. It's a trade-off, as you know,
between overhead and functionality. I try to balance it to the best
of my abilities.

I would strongly recommend APC for a production environment. It
provides about 3x improvement in response time with no downside other
than a few MB of RAM to store all the cached code.

Also, propel 1.3 uses PDO instead of Creole (which is written in PHP)
so you get better performance there as well.

Alan

Reply all
Reply to author
Forward
0 new messages