Hey, great article series 👍
Is it possible that python interpreter might be caching/not gc the file from memory as the code is using it repeatedly and the access time that is shown is actually less (code is faster) than what opening and reading the file 100 times would actually amount to?
I get the point you are making in the article 😅 , but just curious 😁
So as you can see the first call is about 3 times slower than the average. I'd say it's fair to assume that, even though some dark magic might be happening, it's not all that relevant to our experiment, but I'm not sure where this difference is coming from (perhaps some material for another post? 😄)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey, great article series 👍
Is it possible that python interpreter might be caching/not gc the file from memory as the code is using it repeatedly and the access time that is shown is actually less (code is faster) than what opening and reading the file 100 times would actually amount to?
I get the point you are making in the article 😅 , but just curious 😁
Hey there! Thank you for the comment :D
So I think python has some optimizations for that, so I've done some further testing:
So as you can see the first call is about 3 times slower than the average. I'd say it's fair to assume that, even though some dark magic might be happening, it's not all that relevant to our experiment, but I'm not sure where this difference is coming from (perhaps some material for another post? 😄)