Reply to Re: [PHP] Parsing a large file

Your name:

Reply:


Posted by "Richard Lynch" on 01/14/06 01:12

On Fri, January 13, 2006 4:47 pm, Jay Paulson wrote:
>> Buffering 10 lines of text in PHP is probably not going to make a
>> significant difference...
>
> This is true. It's what I have written to start with. Basically I'm
> just
> trying to make sure that I'm not hogging system memory with a huge
> file b/c
> there are other apps running at the same time that need system
> resources as
> well. That's the main reason why I'm using a buffer to read the file
> in and
> parse it a little at a time. By all means test it out on your
> hardware and
> see what that buffer needs to be.

I'm not saying not to read it a little at a time.

I'm saying 1 line at a time, using the most natural code, is PROBABLY
at least as fast as, if not faster than, the 10-line buffer version
posted.

And the 1-line buffer of PHP fgets() is far easier to maintain.

So unless you've got test data to prove the 10-line buffer helps,
throw it out, and just use fgets() 1-line buffer.

:-)

--
Like Music?
http://l-i-e.com/artists.htm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация