diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2023-07-17 21:45:45 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2023-07-17 21:57:16 +0100 |
commit | ad4402cb981077ca5a6eb570c51dc4d6b2bd8e80 (patch) | |
tree | c53d68210c92604cf883685b25ee4ffc67ca68fa | |
parent | deltas: don't clear useful debugging counters when restoring tiles. (diff) | |
download | online-tilewins8.tar.gz online-tilewins8.zip |
deltas: further increase Kit delta cache to 96 tiles.
tilewins8
Should help for single user with large screens.
Also dump delta cache sizes on USR1.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Id16a287be6b05cee5681abe1d9d2dc0ec61cda2a
-rw-r--r-- | kit/Delta.hpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/kit/Delta.hpp b/kit/Delta.hpp index 2547ea3be3..5109485848 100644 --- a/kit/Delta.hpp +++ b/kit/Delta.hpp @@ -114,6 +114,11 @@ class DeltaGenerator { free(_rleData); } + size_t sizeBytes() + { + return sizeof(DeltaBitmapRow) + _rleSize * 4; + } + void initRow(const uint32_t *from, unsigned int width) { uint32_t scratch[width]; @@ -273,6 +278,14 @@ class DeltaGenerator { return _rows[y]; } + size_t sizeBytes() const + { + size_t total = sizeof(DeltaData); + for (int i = 0; i < _height; ++i) + total += _rows[i].sizeBytes(); + return total; + } + void replaceAndFree(std::shared_ptr<DeltaData> &repl) { assert (_loc == repl->_loc); @@ -500,7 +513,7 @@ class DeltaGenerator { /// Adapts cache sizing to the number of sessions void setSessionCount(size_t count) { - rebalanceDeltas(std::max(count, size_t(1)) * 48); + rebalanceDeltas(std::max(count, size_t(1)) * 96); } void dropCache() @@ -512,8 +525,14 @@ class DeltaGenerator { void dumpState(std::ostream& oss) { oss << "\tdelta generator with " << _deltaEntries.size() << " entries vs. max " << _maxEntries << "\n"; + size_t totalSize = 0; for (auto &it : _deltaEntries) - oss << "\t\t" << it->_loc._size << "," << it->_loc._part << "," << it->_loc._left << "," << it->_loc._top << " wid: " << it->getWid() << "\n"; + { + size_t size = it->sizeBytes(); + oss << "\t\t" << it->_loc._size << "," << it->_loc._part << "," << it->_loc._left << "," << it->_loc._top << " wid: " << it->getWid() << " size: " << size << "\n"; + totalSize += size; + } + oss << "\tdelta generator consumes " << totalSize << " bytes\n"; } /** |