[OT] PHP speed question

jbv jbv.silences at club-internet.fr
Tue Oct 31 10:46:55 EST 2006


Hi there,

I'm not trying to change this list into a PHP forum, but I have a
question
regarding speed optimization in PHP, especially about data accumulation
into strings...
I need to accumulate a large number of pixel values into a string before

passing the string back to my Rev cgi script.
Below is the best I managed to code, which is still painfully slow when
compared to what can be achieved with Rev...

Question : is there a way to speed up things ?
In javascript, it is possible to accumulate data into an array, and then
change the
array into a string, which is much much faster than simply accumulating
data in
the string... Is anything similar possible with PHP ?


 $s0 = "" ;
 $s = "" ;

 for($y = 0; $y < $h; $y++) {

    $s0 = "" ;

    for($x = 0; $x < $w; $x++) {

        $s0 .= $myValue1 . " " . $myValue1 . " " . $myValue1 . "\t" ;

    }

  $s .= $s0 . "\n" ;
 }


Thanks,
JB




More information about the use-livecode mailing list