_seek_to_end() performance up - #357
Conversation
linux only, use "/usr/bin/wc" instead native python code, to solve startup very slow problem.
|
Hey, thanks for your PR! I get the motivation here. The old approach is not great. Hardcoding a path to Looking at the code, it seems like it's trying to find the end of the last line in the file? And to do so it's just reading every line in the file until it runs out of lines. I think this is so it ends on a newline or something. Perhaps have it seek to end, and start searching backward for lines to be read by readline(). If it can't find one, seek back further and do it again. Maybe in ~1024 byte chunks? Seek to end. rewind 1024 bytes. readline until complete, return. If no readline in that 1024 bytes, go back 2048, rinse repeat. Just a guess, @josegonzalez would probably have better input on what this code is actually trying to do :) |
|
Closing due to inactivity. Feel free to reopen! |
linux only, use "/usr/bin/wc" instead native python code, to solve startup very slow problem.