For example I open test13456 CSV and close, takes 0.3 seconds, I once again open test13456. CSV and close, takes into 0.15 seconds, tested several files, is always the same, and I found that I went to the open recently have a file open, read speed is very fast, is this why?
CodePudding user response:
Open the file operation in modern operating systems use disk cache to speed up the repeated reading,
The operation of the open file actually not much relationship with python, but also do the cache some methods in python,
Such as the use of numpy compiling methods, after the completion of machine code version of caches function,
If again using the same type of call it, it can be reused the cached version without having to compile again
But the open method