Implement buffering in the DataStream class, to improve performance on Windows.
Summary: The internal QWindowsPipeWriter in Qt doesn't do any buffering, so the first 8 bytes (the tag) were sent first, and the rest only later. This solution uses an explicit flush() method, while doing the flushing in the destructor would have been much more convenient and less error-prone, but the flushing can throw an exception, so we need to do it inside the try/catch -- and certainly not when the stream is deleted because another exception happened. This would all be so much simpler without the use of exceptions :-) Test Plan: all tests pass (on Linux) Reviewers: dvratil, kfunk Reviewed By: dvratil Subscribers: kde-pim Tags: #kde_pim Differential Revision: https://phabricator.kde.org/D29265
Showing with 43 additions and 22 deletions