문제

This is perhaps a very obvious question due simple computer science rules, but is there a good explanation of why it varies so much from time to time? Reading a small file can sometimes take a few milliseconds and other times it can take a few seconds. Of course this depends on how you read the file, and also what language you read it in (i.e the programming language).

Maybe there isn't a obvious answer for this? I'm not sure, I havn't read much about it, so that is why I'm asking the question.

도움이 되었습니까?

해결책

One thing that can cause varying read time is whether the file is in memory or not.

Disk is a much slower read than from memory. So if a file has been read and placed in memory, it will be much quicker to read from that file afterwards, until it gets kicked out of memory.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top