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
- write file after every event. read file , output.
- 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
Post a Comment