3 ms·
I might be wrong, but I believe the fastest way is to seek to the end of file and that way you can get the total file size. Or use like fstat or something Mayb
by ttt0 6y ago
I might be wrong, but I believe the fastest way is to seek to the end of file and that way you can get the total file size. Or use like fstat or something
Maybe scrolling is non trivial, but there is definitely a lot of room for optimizations. You could store large chunks in memory and populate them asynchronously with smaller chunks from file for example.
edit: I completely missed the point with the size, comex's answer is way better