Re: process a BIG string
- From: Erwin Moller <since_humans_read_this_I_am_spammed_too_much@xxxxxxxxxxxxxxxx>
- Date: Thu, 05 Oct 2006 17:33:49 +0200
quamis@xxxxxxxxx wrote:
Hy,
i need to process every character in a file, so i open the file read
in buffers of about 8192bytes and process each buffer, then i write
the output to another file.
the problem is that with large files(>8Mb) i get a script error(Fatal
error: Maximum execution time of 30 seconds exceeded ).
i acess every character in the buffer with
$chr=ord($bufferIn{$i}); (where $i=0...8192)
seems like all he time the script consumes is in the for loop and the
chr/ord functions.
can i do something to speed things up?
is there any other way of acessing a single characher except
$bufferIn{$i} ?
Hi,
I am not sure if you can speed things up in your script, but why not simply
increase the max_execution time?
This can be done with
ini_set("max_execution_time",60);
for 60 seconds.
Have a look here for more options:
http://nl2.php.net/manual/en/ini.php#ini.list
You might also hit the roof of your memory usage if you handle and process
very large file. In that case look at: memory_limit (defaults to 8MB)
Hope that helps.
Regards,
Erwin Moller
.
- Follow-Ups:
- Re: process a BIG string
- From: _q_u_a_m_i_s's
- Re: process a BIG string
- References:
- process a BIG string
- From: quamis@xxxxxxxxx
- process a BIG string
- Prev by Date: Re: Concurrent session issues. Currently our website can have only one window open. Help me solve this.
- Next by Date: Re: process a BIG string
- Previous by thread: process a BIG string
- Next by thread: Re: process a BIG string
- Index(es):
Relevant Pages
|