Mgautierfr has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/314721

Change subject: Always try to cache a cluster, even if it is a uncompressed one.
......................................................................

Always try to cache a cluster, even if it is a uncompressed one.

Creating a cluster is costly. We need to avoid it.

Change-Id: I5a5c384a13d77387d1d7ae020df08c010f82502c
---
M zimlib/src/fileimpl.cpp
1 file changed, 2 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/openzim refs/changes/21/314721/1

diff --git a/zimlib/src/fileimpl.cpp b/zimlib/src/fileimpl.cpp
index cc305d7..2aa9e1f 100644
--- a/zimlib/src/fileimpl.cpp
+++ b/zimlib/src/fileimpl.cpp
@@ -181,13 +181,8 @@
     if (zimFile.fail())
       throw ZimFileFormatError("error reading cluster data");
 
-    if (cluster.isCompressed())
-    {
-      log_debug("put cluster " << idx << " into cluster cache; hits " << 
clusterCache.getHits() << " misses " << clusterCache.getMisses() << " ratio " 
<< clusterCache.hitRatio() * 100 << "% fillfactor " << 
clusterCache.fillfactor());
-      clusterCache.put(idx, cluster);
-    }
-    else
-      log_debug("cluster " << idx << " is not compressed - do not cache");
+    log_debug("put cluster " << idx << " into cluster cache; hits " << 
clusterCache.getHits() << " misses " << clusterCache.getMisses() << " ratio " 
<< clusterCache.hitRatio() * 100 << "% fillfactor " << 
clusterCache.fillfactor());
+    clusterCache.put(idx, cluster);
 
     return cluster;
   }

-- 
To view, visit https://gerrit.wikimedia.org/r/314721
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a5c384a13d77387d1d7ae020df08c010f82502c
Gerrit-PatchSet: 1
Gerrit-Project: openzim
Gerrit-Branch: master
Gerrit-Owner: Mgautierfr <mgaut...@kymeria.fr>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to