summaryrefslogtreecommitdiff
path: root/package/source
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-11-04 09:18:57 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-11-17 10:49:24 +0100
commitd09b6209f1f374b6069089d8583c9ee373e3c1e5 (patch)
tree1e650ea97bf18d2224fbdb75deed9c34c2cfc22c /package/source
parent062cf187026f55001ab4661b89242d13c6ed71d7 (diff)
package: Do not deflate small streams in a thread
Change-Id: Iae804a34f344aa793a6d5c13315f7bc1eb64c0a2
Diffstat (limited to 'package/source')
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 90f0df8e4da8..5eaa6e951220 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -798,6 +798,11 @@ bool ZipPackageStream::saveChild(
else
{
bParallelDeflate = true;
+ // Do not deflate small streams in a thread
+ uno::Reference< io::XSeekable > xSeek( xStream, uno::UNO_QUERY );
+ if (xSeek.is() && xSeek->getLength() < 100000)
+ bParallelDeflate = false;
+
if (bParallelDeflate)
{
// Start a new thread deflating this zip entry