TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Show Off (http://www.talkphp.com/show-off/)
-   -   Tutorial Series (http://www.talkphp.com/show-off/3227-tutorial-series.html)

Speeple 08-10-2008 08:33 PM

Tutorial Series
 
Hi,

I'm working on a series of blog posts on the topic of PHP optimisation.

Here's the first instalment: Compiling PHP – PHP Performance Optimization

Any feedback on technical errors etc. would be much appreciated.

Yes I know you hate my writing style as much as I do, but if there is anything especially inarticulate please let me know :-) ^^

- Cheers!

delayedinsanity 08-10-2008 09:52 PM

Your example of how you compile PHP is interesting, but you don't really go into any detail on why you compile it like that. That's pretty important so people don't try and compile it the same as you and then wonder why they're missing a lot of functionality - for example, and I may be incorrect about what this is doing, but you seem to be turning off a lot of VERY important/useful features, such as PDO, hash, session functionality (??????, why?), simpleXML and Reflection.

Now granted a beginner may not need some of those features, but they're going to be confused as hell when they try to use something like sessions and it's not there. I repeat, turning off session support? And hashes, which I'm assuming has to do with md5 and sha1 support... why turn these off? Reflection maybe, though once you become familiar with it, it's damn near indispensible. SimpleXML maybe... even PDO maybe... but SESSIONS? heh. Why?!
-m

Kalle 08-10-2008 10:32 PM

Quote:

Originally Posted by delayedinsanity (Post 17696)
Your example of how you compile PHP is interesting, but you don't really go into any detail on why you compile it like that. That's pretty important so people don't try and compile it the same as you and then wonder why they're missing a lot of functionality - for example, and I may be incorrect about what this is doing, but you seem to be turning off a lot of VERY important/useful features, such as PDO, hash, session functionality (??????, why?), simpleXML and Reflection.

Now granted a beginner may not need some of those features, but they're going to be confused as hell when they try to use something like sessions and it's not there. I repeat, turning off session support? And hashes, which I'm assuming has to do with md5 and sha1 support... why turn these off? Reflection maybe, though once you become familiar with it, it's damn near indispensible. SimpleXML maybe... even PDO maybe... but SESSIONS? heh. Why?!
-m

"hash" means the hash extension (php-src/ext/hash). Functions like sha1(), md5() is apart of the core (documented on php.net).


And for the example, I would rather just do a "configure" that enables all default extensions and there from use additional arguments like "configure --with-mysql --with-mysqli"

delayedinsanity 08-10-2008 11:08 PM

Quote:

"hash" means the hash extension (php-src/ext/hash). Functions like sha1(), md5() is apart of the core (documented on php.net).
I kind of thought that the md5/sha1 functions were core, but when I tried to find a man page on compilation directives, I turned up a whole lot of nothings.
-m

Speeple 08-10-2008 11:20 PM

delayedinsanity,

The configuration is specific to my environment, but I agree there needs to be some clarification. PDO, HASH, reflection, and session functionality is something I simply don't use. I maintain XML support via DOM, I just personally don't use the SimpleXML set of classes.

PDO - I use MySQL native driver (MySQL :: MySQL native driver for PHP - mysqlnd)
HASH - Beyond MD5/SHAx I don't require extra hashing capabilities - what % of users do?
SimpleXML - I use PHP primarily as a middle man for XSL transformations.

Thanks for the feedback tho, it's much appreciated.

delayedinsanity 08-10-2008 11:33 PM

That's what I was getting at in the end - your configuration is specific to your environment, and the tutorial should make a strong note of that, or provide an example that generalizes the optimization to a variety of environments.

I'm not sure how I read to others, but I wasn't trying to trash your set up so you know, just point out that it may not be suitable to others reading your tutorial. I can't live without sessions and reflection myself, but again I'm not saying that I'm the general public either. ;-)
-m

Speeple 08-11-2008 01:32 PM

Thanks buddy.

I've done some amendments taking note of the issues you brought up, e.g. more emphasis on the example configuration and notes to why.

Again, not really pleased with my writing style but there's no way around it :)

Kalle 08-11-2008 10:31 PM

Seeing you do so many --disable-X and --without-X, then it would be easier to just say --disable-all and then --enable/--with those you need. Remember it requires you to define --enable-object-out-dir=DIR (atleast on Windows)

Speeple 08-12-2008 09:24 AM

That would certainly simplify my configuration for re-use but it wouldn't allow me to write comments explaining why I disabled a certain feature.

I will add your suggestion in a revision of the post tho, cause it's certainly a very good tip!


All times are GMT. The time now is 04:13 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0