Reply to Re: Writing multilingual site - how to effectively output strings depending on language

Your name:

Reply:


Posted by Richard Levasseur on 07/12/06 15:13

Marcin Dobrucki wrote:
> Tony Marston wrote:
>
> > Since when does reading from memory cause a read from disk?
>
> Well, with virtual memory, that is quite possible. However, seeing as
> the file will probably be in the file cache, and will probably be
> accessed frequently during the page generation, disk access should be
> very limited.
>
> /Marcin

Reading a single file is going to be faster and more efficient, by and
large. There is a substantial amount of overhead with finding and
opening a file compared to doing a simple read on it (consider the
worst case where the 1000 files are spread out across the entire drive,
causing a longer seek time for every file, granted, the OS will try to
reorder the queue, but there is only so much it can do). The file is
going to be cached in an OS buffer once you start reading data in.
Unless the single file is incredibly, incredibly big or split up on the
physical drive, causing more seeks to load the data in or swapped into
virtual memory (which is unlikely, strings aren't that big), it will be
faster. You also have the advantage that it may not have to be opened
again since all the strings are in memory already, compared to some
sort of dynamic loading scheme. Not to mention whatever it is won't
have to keep track of 1000 open file handles and their related
information.

Its similar with executing a bunch of single SELECT statements or one
big SELECT statement: Parsing, executing, then return of data. Seek,
open, then return of data.

[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

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