提交 9e6d8f71 编写于 作者: K Kohsuke Kawaguchi

build numbers might exhibit some uniformity that makes it problematic with...

build numbers might exhibit some uniformity that makes it problematic with %4==0, so switching to random.

The average memory saving should be about the same.
上级 1bc181a9
......@@ -70,6 +70,7 @@ import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;
import java.util.Set;
import java.util.TreeMap;
import java.util.logging.Level;
......@@ -295,6 +296,8 @@ public class Fingerprinter extends Recorder implements Serializable, DependecyDe
private final AbstractBuild build;
private static final Random rand = new Random();
/**
* From file name to the digest.
*/
......@@ -341,9 +344,9 @@ public class Fingerprinter extends Recorder implements Serializable, DependecyDe
public void onLoad() {
// share data structure with nearby builds, but to keep lazy loading efficient,
// don't go back the history forever. By %4!=0, 4 neighboring builds will share
// don't go back the history forever. By RAND!=0, 4 neighboring builds will share
// the data structure, so we'll get good enough saving.
if (build.getNumber()%4!=0) {
if (rand.nextInt(4)!=0) {
Run pb = build.getPreviousBuild();
if (pb!=null) {
FingerprintAction a = pb.getAction(FingerprintAction.class);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册