pyOneNote
pyOneNote copied to clipboard
Optimized memory usage
-
Removed collecting files content in memory
-
Read files content by chunks
-
Removed redundant conversions e.g.
struct.unpack('{}s'.format(self.cbLength), file.read(self.cbLength))
->file.read(self.cbLength)
-
Added the cli argument
--optimize
to enable optimized memory mode: no json conversion, no bytes.hex() logging etc
It may be useful when handle large files.
comparison
original:
optimized:
Thank you for your contribution and my apologies for the late response. Will try to review this soon