segStore: getIntersectingElements performance tweaks.
authorLoïc Prieur-Drevon <loic.prieurdrevon@gmail.com>
Sun, 4 Dec 2016 17:46:06 +0000 (12:46 -0500)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Thu, 13 Apr 2017 01:30:46 +0000 (21:30 -0400)
commit0ee1e58a086bcd7067a889c74454a1090873cd93
tree0cd50daaa4e3de3a658b38eeb3d0977d19e50785
parent4045095f755deb9a918073b299f1d10c68e3f793
segStore: getIntersectingElements performance tweaks.

Use binarySearch from (Lazy)ArrayList to correctly dimension
the returned ArrayList, resizing such large arrays happens
frequently during insertion and is costly.

Also stop copying elements into a new arraylist prior
to sorting if the returned Iterable is already a new
instance of arraylist.

Optimize TreeMapStore by reducing it to a single instance
of TreeMultiMap and using its ordered properties
efficiently to return intersecting Segments.

Benchmark results below, best if viewed in a spreadsheet:
SegmentStore Test Before (ms) After (ms) Gains (%)
LazyArrayList Fuzzy Iterate sorted by start 220 171 22.2727272727273
LazyArrayList Fuzzy Iterate sorted by end 45 27 40
LazyArrayList Fuzzy Iterate sorted by length 40 23 42.5
LazyArrayList Random Iterate sorted by start 382 289 24.3455497382199
LazyArrayList Random Iterate sorted by end 127 73 42.5196850393701
LazyArrayList Random Iterate sorted by length 119 71 40.3361344537815
Treemap store Ordered Insertion 1640 669 59.2073170731707
Treemap store Fuzzy Insertion 902 403 55.3215077605322
Treemap store Fuzzy Iterate sorted by start 1610 187 88.3850931677019
Treemap store Fuzzy Iterate sorted by end 1570 164 89.5541401273885
Treemap store Fuzzy Iterate sorted by length 1030 125 87.8640776699029
Treemap store Random Insertion 3960 898 77.3232323232323
Treemap store Random Iterate sorted by start 2890 299 89.6539792387543
Treemap store Random Iterate sorted by end 2460 299 87.8455284552846
Treemap store Random Iterate sorted by length 1550 275 82.258064516129
Treemap store Fuzzy First Insertion 923 196 78.7648970747562
Treemap store Fuzzy First Iteration 66 20 69.6969696969697
Treemap store Fuzzy Second Insertion 929 210 77.3950484391819
Treemap store Fuzzy Second Iteration 95 34 64.2105263157895
Treemap store Random First Insertion 3670 384 89.5367847411444
Treemap store Random First Iteration 265 25 90.5660377358491
Treemap store Random Second Insertion 4590 521 88.6492374727669
Treemap store Random Second Iteration 423 56 86.7612293144208

Change-Id: I3ae2191b74f4f2170f44f45a139b866753b2441a
Signed-off-by: Loïc Prieur-Drevon <loic.prieurdrevon@gmail.com>
Reviewed-on: https://git.eclipse.org/r/86334
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
Tested-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
statesystem/org.eclipse.tracecompass.segmentstore.core/src/org/eclipse/tracecompass/internal/segmentstore/core/arraylist/ArrayListStore.java
statesystem/org.eclipse.tracecompass.segmentstore.core/src/org/eclipse/tracecompass/internal/segmentstore/core/arraylist/LazyArrayListStore.java
statesystem/org.eclipse.tracecompass.segmentstore.core/src/org/eclipse/tracecompass/internal/segmentstore/core/treemap/TreeMapStore.java
statesystem/org.eclipse.tracecompass.segmentstore.core/src/org/eclipse/tracecompass/segmentstore/core/ISegmentStore.java
This page took 0.025178 seconds and 5 git commands to generate.