Kelson has submitted this change and it was merged.

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(-)

Approvals:
  Kelson: Verified; Looks good to me, approved



diff --git a/zimlib/src/fileimpl.cpp b/zimlib/src/fileimpl.cpp
index 8c072eb..04fcacd 100644
--- a/zimlib/src/fileimpl.cpp
+++ b/zimlib/src/fileimpl.cpp
@@ -182,13 +182,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: merged
Gerrit-Change-Id: I5a5c384a13d77387d1d7ae020df08c010f82502c
Gerrit-PatchSet: 2
Gerrit-Project: openzim
Gerrit-Branch: master
Gerrit-Owner: Mgautierfr <mgaut...@kymeria.fr>
Gerrit-Reviewer: Kelson <kel...@kiwix.org>

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

Reply via email to