Re: [nyphp-talk] testing a theory

2007-02-20 Thread Dan Cech
tedd wrote: > At 8:22 PM -0500 2/19/07, Paul Houle wrote: >>Here's a fun fact about > always used to write include files like >> >> > >> ...define some functions... >> ...define some classes... >> ...set a few global variables ... >> >> ?>[EOF] >> >>where [EOF] is the end of the file. >> >>

Re: [nyphp-talk] testing a theory

2007-02-20 Thread tedd
At 8:22 PM -0500 2/19/07, Paul Houle wrote: Here's a fun fact about always used to write include files like [EOF] where [EOF] is the end of the file. The trouble was that from time to time, people using certain editors would cause spaces and carriage returns to appear after the ?>.

Re: [nyphp-talk] testing a theory

2007-02-19 Thread CED
Why do you say that the end of file tag is a good standard? - Original Message - From: "Rob Marscher" <[EMAIL PROTECTED]> To: "NYPHP Talk" Sent: Monday, February 19, 2007 11:07 PM Subject: Re: [nyphp-talk] testing a theory > >One day I discovered t

Re: [nyphp-talk] testing a theory

2007-02-19 Thread Rob Marscher
One day I discovered that I didn't need the "?>"... I could just write This technique is part of the coding standard for the Zend Framework. Seems like a good standard to follow:

Re: [nyphp-talk] testing a theory

2007-02-19 Thread Paul Houle
csnyder wrote: Depending on what q() does (output or return?) it might be more natural to use . Usually in the context of templates I like to see functions returning so that output is completely under my control. Some PHP installations support the short tags and and others don't. If you wa

Re: [nyphp-talk] testing a theory

2007-02-17 Thread Jiju Thomas Mathew
echo << or even jump out of code and then in ?> this is the start of a bunch of lines another line yet another http://www.php-trivandrum.org ___ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006

Re: [nyphp-talk] testing a theory

2007-02-17 Thread Daniel Convissor
On Tue, Feb 06, 2007 at 06:39:47PM -0500, Adrian Noland wrote: > $content = "this is the start of a bunch of lines"; > $content .= "another line"; > $content .= "yet another"; > echo $content; If you're just echoing somehting out there is no point in wasting resources/time/etc putting it in a var

Re: [nyphp-talk] testing a theory

2007-02-16 Thread inforequest
AbraCadab Ra abracadabra13-at-gmail.com |nyphp dev/internal group use| wrote: I had the same question which i asked Rasmus after his talk at NYPHPCON mid last year. His answer was that no. It does not made a difference or at least it does not make enough of a difference to bother with. Cheers,

Re: [nyphp-talk] testing a theory

2007-02-16 Thread AbraCadab Ra
I had the same question which i asked Rasmus after his talk at NYPHPCON mid last year. His answer was that no. It does not made a difference or at least it does not make enough of a difference to bother with. Cheers, Yusuf. On 2/7/07, tedd <[EMAIL PROTECTED]> wrote: >At 2:43 PM -0500 2/7/07, Ad

Re: [nyphp-talk] testing a theory

2007-02-07 Thread tedd
At 2:43 PM -0500 2/7/07, Adrian Noland wrote: I guess the answer is going to be "It depends" on what you are doing. I guess that the real answer is -- it really doesn't matter. It's one of those geek things that we get involved in that others roll their eyes about. Cheers, tedd -- ---

Re: [nyphp-talk] testing a theory

2007-02-07 Thread Adrian Noland
On 2/7/07, Adrian Noland <[EMAIL PROTECTED]> wrote: The loop is optimizing the results. Here is what I got when I replaced them with 115K direct strings. Without profiling Concatenation took 4.47135686874. Multiple echoes took 5.18587899208. Concatenation took 4.42481684685. Multiple echoes took

Re: [nyphp-talk] testing a theory

2007-02-07 Thread Adrian Noland
On 2/7/07, Rob Marscher <[EMAIL PROTECTED]> wrote: OK... I got interested enough to do a test myself. I ran it a few times with 100,000 loops of concatenating vs. echoing. The average result was about this: Concatenation took 0.13881587982178. Multiple echoes took 0.074604988098145. Concat mem

Re: [nyphp-talk] testing a theory

2007-02-07 Thread Rob Marscher
OK... I got interested enough to do a test myself. I ran it a few times with 100,000 loops of concatenating vs. echoing. The average result was about this: Concatenation took 0.13881587982178. Multiple echoes took 0.074604988098145. Concat mem usage was 1760704. Multiple echo mem usage was 901

Re: [nyphp-talk] testing a theory

2007-02-07 Thread tedd
At 11:37 AM -0500 2/7/07, Chris Shiflett wrote: Micro-optimizations never matter in the real world anyway. See Amdahl's Law: http://en.wikipedia.org/wiki/Amdahl's_Law Hope that helps. Chris Chris: Yes, my wife observes that when she tells me to hurry up in taking out the trash -- no matte

Re: [nyphp-talk] testing a theory

2007-02-07 Thread Chris Shiflett
Aaron Fischer wrote: > How would one test something like this? Use an external tool like ab (bundled with Apache). Micro-optimizations never matter in the real world anyway. See Amdahl's Law: http://en.wikipedia.org/wiki/Amdahl's_Law Hope that helps. Chris -- Chris Shiflett http://shiflett.o

Re: [nyphp-talk] testing a theory

2007-02-07 Thread Adrian Noland
On 2/7/07, tedd <[EMAIL PROTECTED]> wrote: No offense meant, but when I have a question like that, I test it and find out. Why ask the list for something you could test yourself? tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com Naw, fair enough. I got ra

Re: [nyphp-talk] testing a theory

2007-02-07 Thread tedd
At 11:20 AM -0500 2/7/07, Aaron Fischer wrote: How would one test something like this? Testing for performance is something I would like to start doing but I don't know where/how to start. -Aaron -Aaron: Ahhh, now that's a different critter. First, your question deals with time, so a time

Re: [nyphp-talk] testing a theory

2007-02-07 Thread Aaron Fischer
Thanks Brian, that's a helpful example to get me going. -Aaron On Feb 7, 2007, at 11:31 AM, Brian Dailey wrote: The easiest way (I would think) is to run them both in a loop. Run option 1 1000 times, and record the start time and end time, output the total time it took to run it. Do the sam

Re: [nyphp-talk] testing a theory

2007-02-07 Thread csnyder
On 2/6/07, Paul Houle <[EMAIL PROTECTED]> wrote: Urb LeJeune wrote: > > It's called a "here document" structure and can include variables. > > One note of caution. There can be no spaces at the end of either the > first or second "Content" and the last one must begin in column one. > That's o

Re: [nyphp-talk] testing a theory

2007-02-07 Thread drydell
> > Best of luck! google is your friend, heh.> >Unless you've owned their stock > > for the past week or so  ;) ___ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphp

Re: [nyphp-talk] testing a theory

2007-02-07 Thread Brian Dailey
The easiest way (I would think) is to run them both in a loop. Run option 1 1000 times, and record the start time and end time, output the total time it took to run it. Do the same with option 2 and compare the results. - Brian Aaron Fischer wrote: How would one test something like this? Tes

Re: [nyphp-talk] testing a theory

2007-02-07 Thread Rob Marscher
Ben Sgro (ProjectSkyline) wrote: First the "'s need to be checked for $variables, it would be quicker to put '. And then an operation of copying needs to be done. Allocation as well on the c side for the new, larger variable. I've looked into this kind of thing before and the performance diffe

Re: [nyphp-talk] testing a theory

2007-02-07 Thread Ben Sgro \(ProjectSkyline\)
uot;NYPHP Talk" Sent: Wednesday, February 07, 2007 11:20 AM Subject: Re: [nyphp-talk] testing a theory How would one test something like this? Testing for performance is something I would like to start doing but I don't know where/how to start. -Aaron On Feb 7, 2007, at 11:05 AM

Re: [nyphp-talk] testing a theory

2007-02-07 Thread Aaron Fischer
How would one test something like this? Testing for performance is something I would like to start doing but I don't know where/how to start. -Aaron On Feb 7, 2007, at 11:05 AM, tedd wrote: No offense meant, but when I have a question like that, I test it and find out. Why ask the list f

Re: [nyphp-talk] testing a theory

2007-02-07 Thread tedd
At 6:39 PM -0500 2/6/07, Adrian Noland wrote: Hi, I have a quick (and probably silly) question. Is there performance difference between the following two snippets. Does it make a difference if there are hundreds+ of lines? vs. No offense meant, but when I have a question like that, I test

Re: [nyphp-talk] testing a theory

2007-02-07 Thread David Krings
Urb LeJeune wrote: I did a performance test on just this type of thing and there was no discernable difference. Why not do the following which makes the code much easier to follow and modify $Content=<< And I guess you cannot use Content; as part of the document. Do I assume right that it doesn

Re: [nyphp-talk] testing a theory

2007-02-06 Thread Kenneth Downs
Paul Houle wrote: Urb LeJeune wrote: It's called a "here document" structure and can include variables. One note of caution. There can be no spaces at the end of either the first or second "Content" and the last one must begin in column one. That's one reason I don't like here variables.

Re: [nyphp-talk] testing a theory

2007-02-06 Thread Paul Houle
Urb LeJeune wrote: It's called a "here document" structure and can include variables. One note of caution. There can be no spaces at the end of either the first or second "Content" and the last one must begin in column one. That's one reason I don't like here variables. People mash them up

Re: [nyphp-talk] testing a theory

2007-02-06 Thread Urb LeJeune
I did a performance test on just this type of thing and there was no discernable difference. Why not do the following which makes the code much easier to follow and modify $Content=<< ?> vs. ___ New York PHP Community Talk Mailing List http://li

Re: [nyphp-talk] testing a theory

2007-02-06 Thread Kenneth Downs
Adrian Noland wrote: Hi, I have a quick (and probably silly) question. Is there performance difference between the following two snippets. Does it make a difference if there are hundreds+ of lines? I can offer a few rules of thumb from experience. First, in any situation where there is disk or

RE: [nyphp-talk] testing a theory

2007-02-06 Thread Nicholas Tang
Ben Sgro (ProjectSkyline) Sent: Tuesday, February 06, 2007 6:48 PM To: NYPHP Talk Subject: Re: [nyphp-talk] testing a theory Well, My guess (no facts here) would be the first is slower. First the "'s need to be checked for $variables, it would be quicker to put '. And then

Re: [nyphp-talk] testing a theory

2007-02-06 Thread Ben Sgro \(ProjectSkyline\)
second snippet displays the lines without the additional operation of allocation/concatenation. Who knows though..I'd like a more fact based explanation. - Ben - Original Message - From: "Adrian Noland" <[EMAIL PROTECTED]> To: Sent: Tuesday, February 06, 2007 6:3

[nyphp-talk] testing a theory

2007-02-06 Thread Adrian Noland
Hi, I have a quick (and probably silly) question. Is there performance difference between the following two snippets. Does it make a difference if there are hundreds+ of lines? vs. ___ New York PHP Community Talk Mailing List http://lists.nyphp.org/