[ctf] Fix binary search for a long sequence of same timestamps.
authorEtienne Bergeron <etienne.bergeron@gmail.com>
Thu, 21 Nov 2013 00:03:05 +0000 (19:03 -0500)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Mon, 25 Nov 2013 22:35:12 +0000 (17:35 -0500)
commitd68f46c20bf072ec253989224760a40aa0bcfa9b
treeef2137a6c08ff0ffe0fe2096dbc7252dbd4588ea
parentb2b36236523d1ab3e6798f4ec75b56656147206e
[ctf] Fix binary search for a long sequence of same timestamps.

The binary search algorithm does not need a third case
(when values are equals) if there is a guarantee to remove
one element in the search space at each iteration.
The actual binary search implementation performs a sequential
search on elements with the same timestamp (to find the first
one).

The ETW2CTF traces produce many debug events for the debugging
information at the module load timestamp. Which is the worse
case for the actual implementation.

We changed the algorithm to use the timestamp end of a packet
instead of the beginning. We changed the way to choose a
middle element to ease the recursion by using only two cases.

Change-Id: I4f16d43b9533f8f1449cdb3c4c213bcb9f962daf
Signed-off-by: Etienne Bergeron <etienne.bergeron@gmail.com>
Reviewed-on: https://git.eclipse.org/r/18654
Reviewed-by: Matthias Nick <Matthias.Nick@bsiag.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tested-by: Hudson CI
IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Tested-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/StreamInputPacketIndex.java
This page took 0.034116 seconds and 5 git commands to generate.