hard drive - Reading a small file k times + small writes vs read large file k times + small appends -


i have make decision script shows recent event.

each event can less 250 bytes.

there 2 ways this

  1. write file after every event. read file , output.
  2. append file after every event. read entire file, find last item, output. (the size of file can grow pretty big, 1mb)

assuming reads frequent(up once per second), writes quite frequent (say around 1000 times per day)

which way better hard drive?

don't worry it. hard drives cached (read , write).

do simplest , easiest understand.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

c# - SharpSVN - How to get the previous revision? -

php cli reading files and how to fix it? -