diff options
author | Noel Grandin <noel@peralex.com> | 2021-06-21 12:54:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-23 14:29:57 +0200 |
commit | 9815bf197c27afdfeccf967898c3a000bcf7b256 (patch) | |
tree | 220d5f3dd9b95c9ef898d6b92cc9c7de81ad7213 /include | |
parent | 90df123cd9ff9fc1c7b991d9ae9a1ed8c9e9f0de (diff) |
tdf#135316 add SvFileStream::SetDontFlushOnClose
if we're going to be deleting a temporary file, there is no point
flushing it on close, which has a measureable cost
This takes my load time from 17s to 16s
Change-Id: I2fce7eeaf0ce9fef826b4ce9a1a4d4c8114cac76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117607
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/tools/stream.hxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx index f99b09955368..e99d41c8ac45 100644 --- a/include/tools/stream.hxx +++ b/include/tools/stream.hxx @@ -49,7 +49,7 @@ enum class StreamMode { NOCREATE = 0x0004, ///< 1 == Don't create file TRUNC = 0x0008, ///< Truncate _existing_ file to zero length COPY_ON_SYMLINK = 0x0010, ///< copy-on-write for symlinks (Unix) - TEMPORARY = 0x0020, ///< temporary file attribute (Windows) + TEMPORARY = 0x0020, ///< temporary file attribute (Windows-only) // sharing options SHARE_DENYNONE = 0x0100, SHARE_DENYREAD = 0x0200, // overrides denynone @@ -586,6 +586,7 @@ private: sal_uInt16 nLockCounter; #endif bool bIsOpen; + bool mbDontFlushOnClose; ///< used to avoid flushing when closing temporary files SvFileStream (const SvFileStream&) = delete; SvFileStream & operator= (const SvFileStream&) = delete; @@ -612,6 +613,7 @@ public: bool IsOpen() const { return bIsOpen; } const OUString& GetFileName() const { return aFilename; } + void SetDontFlushOnClose(bool b) { mbDontFlushOnClose = b; } }; // MemoryStream |