[MediaWiki-commits] [Gerrit] openzim[master]: Always try to cache a cluster, even if it is a uncompressed ...

2017-03-25 Thread Kelson (Code Review)
Kelson has submitted this change and it was merged. ( 
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(-)

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 
Gerrit-Reviewer: Kelson 

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


[MediaWiki-commits] [Gerrit] openzim[master]: Always try to cache a cluster, even if it is a uncompressed ...

2016-10-09 Thread Kelson (Code Review)
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 
Gerrit-Reviewer: Kelson 

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


[MediaWiki-commits] [Gerrit] openzim[master]: Always try to cache a cluster, even if it is a uncompressed ...

2016-10-07 Thread Mgautierfr (Code Review)
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 

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