summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2021-06-21 12:54:29 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-06-25 12:18:16 +0200
commit3837434dfb3a673a05d91b063e7ac2025589f32f (patch)
treebab4477e4a865cd684129cbbaa2562318fbe0a14 /unotools
parent3156e46277822ec7fbd2e93482a6c576e06b728a (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> (cherry picked from commit 9815bf197c27afdfeccf967898c3a000bcf7b256) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117731
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index c63287efe114..25c15920d52b 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -386,6 +386,9 @@ TempFile::TempFile(TempFile && other) noexcept :
TempFile::~TempFile()
{
+ // if we're going to delete this file, no point in flushing it when closing
+ if (pStream && bKillingFileEnabled && !aName.isEmpty())
+ static_cast<SvFileStream*>(pStream.get())->SetDontFlushOnClose(true);
pStream.reset();
if ( bKillingFileEnabled )
{