Re: [PHP] Structured Code vs. Performance

2007-12-03 Thread Martin Alterisio
2007/12/2, tedd <[EMAIL PROTECTED]>: > > Oh yes, it's very much like fractals, but the term "fractalism" is > usually reserved for art forms based on fractals. > > However, one could conclude that all crystalline forms are a > "real-world" examples of fractals. In similar vein, all repetitive > pro

Re: [PHP] Structured Code vs. Performance

2007-12-02 Thread tedd
At 8:56 PM -0300 12/2/07, Martin Alterisio wrote: 2007/12/2, tedd <[EMAIL PROTECTED]>: To me, good structure starts at the function level. Like the lattice of a crystal, coding grows and reflects the most basic element. Keep that element consistent and you'll find that

Re: [PHP] Structured Code vs. Performance

2007-12-02 Thread Martin Alterisio
2007/12/2, tedd <[EMAIL PROTECTED]>: > > > To me, good structure starts at the function level. Like the lattice > of a crystal, coding grows and reflects the most basic element. Keep > that element consistent and you'll find that it will be reflected in > everything you do. > > How's that for philo

Re: [PHP] Structured Code vs. Performance

2007-12-02 Thread tedd
At 8:56 AM +0100 11/29/07, <[EMAIL PROTECTED]> wrote: Looks for me a bit like a philosophical question, but maybe you have something to say about it nevertheless. A good thing for me would be something like: up to 125 lines of code you get an adequate performance with simply parsing it every time

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Robert Cummings
On Thu, 2007-11-29 at 16:49 +, Stut wrote: > Robert Cummings wrote: > > On Thu, 2007-11-29 at 12:13 +, Stut wrote: > >> Not ;). There is no such thing as a compile-time definition in PHP. > > > > There certainly is... > > > > > > > if( !function_exists( 'file_put_contents' ) ) > > { > >

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Stut
Robert Cummings wrote: On Thu, 2007-11-29 at 12:13 +, Stut wrote: Not ;). There is no such thing as a compile-time definition in PHP. There certainly is... function file_put_contents ( \$filename, \$data, \$flags=0, \$context=null ) { /

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Robert Cummings
On Thu, 2007-11-29 at 12:13 +, Stut wrote: > > Not ;). There is no such thing as a compile-time definition in PHP. There certainly is... Now, I'm not necessarily advocating this style of compatibility programming, but I remember seeing something like it in PEAR. I think it might have been t

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Larry Garfield
On Thursday 29 November 2007, Jochem Maas wrote: > okay, but I was just paraphrasing the man Rasmus, although I admit I may > have misinterpreted (or misundersstood the 'why') - thought I pretty sure > he has written on a number of occasions that code like the following sucks > for op-code caches

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread T . Lensselink
On Thu, 29 Nov 2007 14:54:43 +0100, Jochem Maas <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> Just to be curious: >> >> when something like >> >> if (defined('FOO') && FOO) { >> class foo{}; >> function foo(){}; >> } >> >> is parsed and FOO is not defined, will the code inside be par

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread news_yodpeirs
> they have a word very suitable to this situation in dutch 'mierenneuken', > personally I'd stick with pretty girls. OT: Couldn't translate that in german, the nearest approach seems to be "Haarspalterei" but unfortunately for me this seems not to match the situation. And it doesn't meet pretty

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Jochem Maas
[EMAIL PROTECTED] wrote: > Just to be curious: > > when something like > > if (defined('FOO') && FOO) { > class foo{}; > function foo(){}; > } > > is parsed and FOO is not defined, will the code inside be parsed > nevertheless? Or is anything inside skipped, leading to a (fragments of > mi

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread news_yodpeirs
Just to be curious: when something like if (defined('FOO') && FOO) { class foo{}; function foo(){}; } is parsed and FOO is not defined, will the code inside be parsed nevertheless? Or is anything inside skipped, leading to a (fragments of microseconds) faster handling of the code? Thus to

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Stut
Jochem Maas wrote: Stut wrote: Jochem Maas wrote: Stut wrote: Jo chem baas wrote: ^- wtf happened here? :-) it's quite funny if you know dutch :-) Pass. Looking back it looks like it happened one of the times I replied. Didn't do it on purpose, honest! ;) Whether there is c

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Jochem Maas
Stut wrote: > Jochem Maas wrote: >> Stut wrote: >>> Jo chem baas wrote: ^- wtf happened here? :-) it's quite funny if you know dutch :-) ... >>> Whether there is conditional definition or not, the opcode cache will >>> look the same. The reason for this is that function and class >>>

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Paul Scott
On Thu, 2007-11-29 at 13:51 +0100, Jochem Maas wrote: > okay, but I was just paraphrasing the man Rasmus, although I admit I > may > have misinterpreted (or misundersstood the 'why') - thought I pretty > sure > he has written on a number of occasions that code like the following > sucks > for op-c

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Stut
Jochem Maas wrote: Stut wrote: Jo chem baas wrote: Stut wrote: Jochem Maas wrote: [EMAIL PROTECTED] wrote: I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance:

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Jochem Maas
Stut wrote: > Jo chem baas wrote: >> Stut wrote: >>> Jochem Maas wrote: [EMAIL PROTECTED] wrote: > I got different portions of code only used for certain purposes (who > don't ;-)?). But what, in your opinion (better: in your experience) > would be the best regarding script-perform

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Stut
Jo chem baas wrote: Stut wrote: Jochem Maas wrote: [EMAIL PROTECTED] wrote: I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance: Putting each code-portion in a se

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Jochem Maas
Stut wrote: > Jochem Maas wrote: >> [EMAIL PROTECTED] wrote: >>> I got different portions of code only used for certain purposes (who >>> don't ;-)?). But what, in your opinion (better: in your experience) >>> would be the best regarding script-performance: Putting each >>> code-portion in a separa

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Stut
Jochem Maas wrote: [EMAIL PROTECTED] wrote: I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance: Putting each code-portion in a separate file and include it if re

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Jochem Maas
Tomi Kaistila wrote: ... > > You can avoid duplication by only using require_once or include_once. PHP indeed require_once() and include_once() help with maintainability but it should be mentioned that if you are going to use an op-code cache (as Rob Cummings mentioned also) then it is highly r

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Jochem Maas
[EMAIL PROTECTED] wrote: > I got different portions of code only used for certain purposes (who don't > ;-)?). But what, in your opinion (better: in your experience) would be the > best regarding script-performance: Putting each code-portion in a separate > file and include it if required, putti

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Chris
[EMAIL PROTECTED] wrote: I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance: Putting each code-portion in a separate file and include it if required, putting it i

RE: [PHP] Structured Code vs. Performance

2007-11-29 Thread Tomi Kaistila
> I got different portions of code only used for certain purposes (who > don't > ;-)?). But what, in your opinion (better: in your experience) would be > the > best regarding script-performance: Putting each code-portion in a > separate > file and include it if required, putting it in a constant-de

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Robert Cummings
On Thu, 2007-11-29 at 08:56 +0100, [EMAIL PROTECTED] wrote: > I got different portions of code only used for certain purposes (who don't > ;-)?). But what, in your opinion (better: in your experience) would be the > best regarding script-performance: Putting each code-portion in a separate > fil

[PHP] Structured Code vs. Performance

2007-11-29 Thread news_yodpeirs
I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance: Putting each code-portion in a separate file and include it if required, putting it in a constant-dependent if