Benchmarking effects of only using writeLong instead of writeInt

This commit is contained in:
expani 2024-10-18 15:40:05 +05:30
parent 359440a7dc
commit 4406d75b00
1 changed files with 9 additions and 4 deletions

View File

@ -309,7 +309,8 @@ public class DocIdEncodingBenchmark {
out.writeLong(packedLong);
}
for (; i < count; i++) {
out.writeInt(docIds[i]);
//out.writeInt(docIds[i]);
out.writeLong(docIds[i]);
}
}
@ -323,7 +324,8 @@ public class DocIdEncodingBenchmark {
docIDs[i + 2] = (int) (packedLong & BPV_21_MASK);
}
for (; i < count; i++) {
docIDs[i] = in.readInt();
//docIDs[i] = in.readInt();
docIDs[i] = (int) in.readLong();
}
}
}
@ -363,7 +365,8 @@ public class DocIdEncodingBenchmark {
out.writeLong(packedLong);
}
for (; i < count; i++) {
out.writeInt(docIds[i]);
//out.writeInt(docIds[i]);
out.writeLong(docIds[i]);
}
}
@ -391,7 +394,8 @@ public class DocIdEncodingBenchmark {
docIDs[i + 2] = (int) (packedLong & BPV_21_MASK);
}
for (; i < count; i++) {
docIDs[i] = in.readInt();
//docIDs[i] = in.readInt();
docIDs[i] = (int) in.readLong();
}
}
}
@ -539,5 +543,6 @@ public class DocIdEncodingBenchmark {
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}