Re: .= very slow !

From: Hayden Kirk (spam_at_spam.com)
Date: 03/23/04


Date: Tue, 23 Mar 2004 11:56:59 +1200

Thats why I never use that method... easier to read, nicer code... does not
perform very well..

"Pascal H" <mmm@mmm.com> wrote in message
news:405f7a1b$0$314$636a15ce@news.free.fr...
> Hi,
>
> I discovered something which surprised me today:
>
> version 1/
> $toto = "";
> while (mysql->fetchrow) (about 400 times)
> {
> $toto .= "row1 row2 row3";
> }
>
> => took 60s
>
> version 2/
> array $toto;
> while (mysql->fetchrow) (about 400 times)
> {
> $toto[] = "row1 row2 row3";
> }
> is veryyyy faster ... 3s !
>
> I discovered a difference with perl too but version 1 takes 8s only
>
>



Relevant Pages

  • Re: Question about events and object arrays
    ... The reason was that I was experimenting making as ... dum linear data structure and thats why I needed the indices, ... > you would assign a property indicating the index in the array it is at. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Rijndael encryption - can I supply my own encryption key?
    ... the key needs to be a byte array - might want to ... check thats what your providing. ... John Timney (MVP) ...
    (microsoft.public.dotnet.general)
  • Re: Sum-if-product
    ... Thats it. ... SOme of the data in the array were errors. ... error in any of the ranges ... Peo Sjoblom ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Any way to take a word as input from stdin ?
    ... call it get_words but that is not important) and sort the array and ... That gives you more learning! ... well,thats what I am doing. ...
    (comp.lang.c)
  • Re: vb6
    ... There is one more thing I m tring to do and thats ... > I tryed code but doesn t work it only shows last pic in array ...
    (microsoft.public.vb.general.discussion)