[Libreoffice-commits] online.git: 2 commits - kit/Kit.cpp tools/map.cpp
Michael Meeks
michael.meeks at collabora.com
Mon Dec 4 22:03:32 UTC 2017
kit/Kit.cpp | 4 ++++
tools/map.cpp | 47 ++++++++++++++++++++---------------------------
2 files changed, 24 insertions(+), 27 deletions(-)
New commits:
commit e11794da2551639e52d9f94867f6f35bae40a6c4
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Mon Dec 4 16:11:03 2017 +0000
Disable delta generator for now.
Change-Id: I7aee52b5dc0dc0b09868170e50afc8ccb0e2f7b6
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index ac06a8d4..37405142 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -411,10 +411,14 @@ class PngCache
TileBinaryHash hash, TileWireId wid, TileWireId oldWid)
{
LOG_DBG("PNG cache with hash " << hash << " missed.");
+/*
+ *Disable for now - pushed in error.
+ *
if (_deltaGen.createDelta(pixmap, startX, startY, width, height,
bufferWidth, bufferHeight,
output, wid, oldWid))
return true;
+*/
LOG_DBG("Encode a new png for this tile.");
CacheEntry newEntry(bufferWidth * bufferHeight * 1, wid);
commit 73327ce2ecad60c11ce04853fe6e183617143c25
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Fri Dec 1 17:58:08 2017 +0000
loolmap: more cleanup print more metrics.
Change-Id: Ie6d82222a5d8960a317ea22d0628e6250330bbc7
diff --git a/tools/map.cpp b/tools/map.cpp
index a95455c1..413576d7 100644
--- a/tools/map.cpp
+++ b/tools/map.cpp
@@ -129,14 +129,6 @@ static void dumpDiff(const std::string &pageStr, const std::string &parentStr)
}
}
-static bool pageIsZero(const std::vector<char> &page)
-{
- for (char c : page)
- if (c != 0)
- return false;
- return true;
-}
-
static void dumpPages(unsigned proc_id, unsigned parent_id, const char *type, const std::vector<addr_t> &pages)
{
char path_proc[PATH_SIZE];
@@ -154,7 +146,8 @@ static void dumpPages(unsigned proc_id, unsigned parent_id, const char *type, co
printf ("\nUn-shared data dump\n");
size_t cnt = 0;
- long long int bytesTouched = 0;
+ addr_t sameButUnshared = 0;
+ addr_t bytesTouched = 0;
for (auto page : pages)
{
std::vector<char> pageData, parentData;
@@ -177,22 +170,32 @@ static void dumpPages(unsigned proc_id, unsigned parent_id, const char *type, co
std::stringstream parentStr;
Util::dumpHex(parentStr, "", "", parentData, false);
- bool matchesParent = pageStr.str() == parentStr.str();
+ int touched = 0;
const char *style;
if (parentData.size() > 0)
{
- if (pageIsZero(parentData))
+ bool bZeroParent = true;
+ for (size_t i = 0; i < pageData.size(); ++i)
{
- style = "was shared with zeros";
- parentData.resize(0);
+ if (pageData[i] != parentData[i])
+ touched++;
+ if (parentData[i] != 0)
+ bZeroParent = false;
+ }
+ if (bZeroParent)
+ {
+ style = "was shared with parent zeros";
+ parentData.resize(0); // diff un-interesting.
}
- if (matchesParent)
+ if (touched == 0)
{
if (DumpAll)
style = "dump unchanged";
else
+ {
style = "un-shared but matches parent";
- parentData.resize(0);
+ sameButUnshared++;
+ }
}
else
style = "was shared";
@@ -200,16 +203,6 @@ static void dumpPages(unsigned proc_id, unsigned parent_id, const char *type, co
else
style = "unique";
- int touched = 0;
- if (parentData.size() > 0)
- {
- for (size_t i = 0; i < pageData.size(); ++i)
- {
- if (pageData[i] != parentData[i])
- touched++;
- }
- }
-
if (DumpHex)
{
printf ("%s page: 0x%.8llx (%d/%d) - touched: %d - %s\n",
@@ -228,7 +221,8 @@ static void dumpPages(unsigned proc_id, unsigned parent_id, const char *type, co
close (mem_fd);
close (parent_fd);
- printf ("\tdirtied bytes touched %5lld per page %.2f\n\n",
+ printf ("\tsame but unshared %6lld (%lldkB)\n", sameButUnshared, sameButUnshared * 4);
+ printf ("\tdirtied bytes touched %6lld per page %.2f\n\n",
bytesTouched, (double)bytesTouched / pages.size());
}
@@ -423,7 +417,6 @@ static unsigned getParent(int proc_id)
path_proc, buffer);
exit (1);
}
- fprintf(stderr,"parent of %u is %u\n", proc_id, ppid);
return ppid;
}
More information about the Libreoffice-commits
mailing list