[Libreoffice-commits] online.git: 2 commits - common/Png.hpp common/Util.cpp
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Apr 23 01:00:51 UTC 2019
common/Png.hpp | 6 ++++++
common/Util.cpp | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
New commits:
commit ed0efde542b9d48b0b48a733f12b302a8b36c0a0
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sat Apr 20 15:23:32 2019 -0400
Commit: Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Tue Apr 23 03:00:44 2019 +0200
wsd: use thread_local instead of __thread
The former is the standard C++ approach
and is reportedly faster than __thread
(at least with gcc).
Change-Id: Ibdefd32172774a280637f73dd062282b7bf62025
Reviewed-on: https://gerrit.libreoffice.org/71019
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/common/Util.cpp b/common/Util.cpp
index ab21e0c96..06a715320 100644
--- a/common/Util.cpp
+++ b/common/Util.cpp
@@ -497,7 +497,7 @@ namespace Util
return replace(r, "\n", " / ");
}
- static __thread char ThreadName[32] = {0};
+ static thread_local char ThreadName[32] = {0};
void setThreadName(const std::string& s)
{
@@ -537,7 +537,7 @@ namespace Util
}
#ifdef __linux
- static __thread pid_t ThreadTid = 0;
+ static thread_local pid_t ThreadTid = 0;
pid_t getThreadId()
#else
commit e76d27188ee11f1387d56b851dc73d83f093be48
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Fri Apr 19 20:09:22 2019 -0400
Commit: Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Tue Apr 23 03:00:31 2019 +0200
wsd: use fast deflate level for png
The default deflate level of 6 is quite slow
and the benefits are hardly worth the high
latency that users experience.
Tested on a writer document with some small
images and a few pages of text:
Level 4 gives virtually identical compression
ratio to level 6, but is between 5-10% faster.
Level 3 runs almost twice as fast as level 6,
but the output is typically 2-3x larger.
Perhaps this should be exposed via config
so it would be possible to reduce latency
due to compression when CPU is scarce but
network bandwidth ample, and vice versa.
Change-Id: Iba88eea8f180d11458b33c68389e797234df1a60
Reviewed-on: https://gerrit.libreoffice.org/71018
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/common/Png.hpp b/common/Png.hpp
index 1cd03f085..d4e1c2cf5 100644
--- a/common/Png.hpp
+++ b/common/Png.hpp
@@ -136,6 +136,12 @@ bool encodeSubBufferToPNG(unsigned char* pixmap, size_t startX, size_t startY,
#if MOBILEAPP
png_set_compression_level(png_ptr, Z_BEST_SPEED);
+#else
+ // Level 4 gives virtually identical compression
+ // ratio to level 6, but is between 5-10% faster.
+ // Level 3 runs almost twice as fast, but the
+ // output is typically 2-3x larger.
+ png_set_compression_level(png_ptr, 4);
#endif
#ifdef IOS
More information about the Libreoffice-commits
mailing list