When nodes are read from disk, we know the intervals fit into it, there
is no need to go through the code path that checks if the interval can
go in the node.
This change alone greatly reduces the performance impact of both single
and full queries for large state system, when nodes are often read from
disk.
Change-Id: If653611b00d56b604d23ddd1f6e62bb22f822da0
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/91756
Reviewed-by: Hudson CI
Reviewed-by: Loic Prieur-Drevon <loic.prieur.drevon@ericsson.com>
ISafeByteBufferReader readBuffer = SafeByteBufferFactory.wrapReader(buffer, res - buffer.position());
for (int i = 0; i < intervalCount; i++) {
E interval = objectReader.readInterval(readBuffer);
- newNode.add(interval);
+ newNode.addNoCheck(interval);
}
/* Assign the node's other information we have read previously */
}
}
+ /**
+ * Directly add the interval to the node, without check. This method is
+ * package private because only the read method should make use of it.
+ */
+ void addNoCheck(E newInterval) {
+ fIntervals.add(newInterval);
+ }
+
@Override
public Iterable<E> getMatchingIntervals(TimeRangeCondition timeCondition,
Predicate<E> extraPredicate) {