[PHP] Loooooooooonnnnnnnnnnggggggggg

2002-11-19 Thread Hacook
Hi all,
I made a script that works on a very long charachter chain and its process
is lnggg about 5 minutes !
Do you have any  tips to make it faster ?
Thanks,
Hacook



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Loooooooooonnnnnnnnnnggggggggg

2002-11-19 Thread Jon Haworth
Hi,

 I made a script that works on a very long charachter 
 chain and its process is lnggg about 5 minutes !
 Do you have any  tips to make it faster ?

My mysterious ninja PHP developer powers have told me that you need to
fiddle with lines 23 and 72, that's where it's slowing down.

IOW, it would be helpful if you could post the code for this script.

Without seeing it the only thing I can suggest is you minimise the amount of
string concatenations, as this is a fairly expensive operation.

Cheers
Jon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Loooooooooonnnnnnnnnnggggggggg

2002-11-19 Thread Justin French
on 19/11/02 10:00 PM, Hacook ([EMAIL PROTECTED]) wrote:

 Do you have any  tips to make it faster ?

The answers will come in faster if you tell us how you're processing it.

Justin French

http://Indent.com.au
Web Developent  
Graphic Design



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Loooooooooonnnnnnnnnnggggggggg

2002-11-19 Thread Marek Kilimajer
die()

but seriosly, if you don't tell us what the script does, we can't tell 
you if it can be made faster

Hacook wrote:

Hi all,
I made a script that works on a very long charachter chain and its process
is lnggg about 5 minutes !
Do you have any  tips to make it faster ?
Thanks,
Hacook



 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Fw: [PHP] Loooooooooonnnnnnnnnnggggggggg

2002-11-19 Thread Tristan Carron

- Original Message -
From: Justin French [EMAIL PROTECTED]
To: Tristan Carron [EMAIL PROTECTED]
Sent: Tuesday, November 19, 2002 12:23 PM
Subject: Re: [PHP] Loonng


 You should post this to the list, not me direct :)

 Justin


 on 19/11/02 10:10 PM, Tristan Carron ([EMAIL PROTECTED]) wrote:

  sorry i forgot the script (excuse me, but i'm dumb)
 
  As the full code is too long, i'll just give u a function that i think
could
  be better, there you go (good luck):
 
  function conte($string){
 
  $number=l($string);
  $i=0;
  $url_modif=;
 
  while($i$number-1){
 
  if($string[$i]==*){
 
 
  for($j=0;$j=$i-1;$j++){
 
  $url_modif=$url_modif.$string[$j];
 
  }
  return $url_modif;
  break;
 
  }
  else{
 
  $i++;
 
  }
 
  }
 
  if(($string!=$url_modif)  ((strlen($url_modif))==0)){
 
  return $string;
 
  }
 
  else {
 
  return $url_modif;
 
  }
 
  }
 
  - Original Message -
  From: Justin French [EMAIL PROTECTED]
  Newsgroups: php.general
  To: Hacook [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Tuesday, November 19, 2002 12:09 PM
  Subject: Re: [PHP] Loonng
 
 
  on 19/11/02 10:00 PM, Hacook ([EMAIL PROTECTED]) wrote:
 
  Do you have any  tips to make it faster ?
 
  The answers will come in faster if you tell us how you're processing
it.
 
  Justin French
  
  http://Indent.com.au
  Web Developent 
  Graphic Design
  
 
 
 

 Justin French
 
 http://Indent.com.au
 Web Developent 
 Graphic Design
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: Fw: [PHP] Loooooooooonnnnnnnnnnggggggggg

2002-11-19 Thread Marek Kilimajer
Your function seems to return string before first occurence of '*'.
This should be faster:

function conte($string) {
   return substr($string,0,strrpos($string,'*'));
}

Tristan Carron wrote:


- Original Message -
From: Justin French [EMAIL PROTECTED]
To: Tristan Carron [EMAIL PROTECTED]
Sent: Tuesday, November 19, 2002 12:23 PM
Subject: Re: [PHP] Loonng


 

You should post this to the list, not me direct :)

Justin


on 19/11/02 10:10 PM, Tristan Carron ([EMAIL PROTECTED]) wrote:

   

sorry i forgot the script (excuse me, but i'm dumb)

As the full code is too long, i'll just give u a function that i think
 

could
 

be better, there you go (good luck):

function conte($string){

$number=l($string);
$i=0;
$url_modif=;

while($i$number-1){

if($string[$i]==*){


for($j=0;$j=$i-1;$j++){

$url_modif=$url_modif.$string[$j];

}
return $url_modif;
break;

}
else{

$i++;

}

}

if(($string!=$url_modif)  ((strlen($url_modif))==0)){

return $string;

}

else {

return $url_modif;

}

}

- Original Message -
From: Justin French [EMAIL PROTECTED]
Newsgroups: php.general
To: Hacook [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, November 19, 2002 12:09 PM
Subject: Re: [PHP] Loonng


 

on 19/11/02 10:00 PM, Hacook ([EMAIL PROTECTED]) wrote:

   

Do you have any  tips to make it faster ?
 

The answers will come in faster if you tell us how you're processing
   

it.
 

Justin French

http://Indent.com.au
Web Developent 
Graphic Design


   

 

Justin French

http://Indent.com.au
Web Developent 
Graphic Design


   



 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php