Build and freeze transaction events in bulk
This commit is contained in:
1 parent
e78c65a36c
commit
75fa1a4f31
10 files changed
+146
-22
No files matched your search
+9
-1
@@ -37,6 +37,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
||||
|
||||
/** The events. */
|
||||
IEventList events = new EventList();
|
||||
private EventList.Builder eventBuilder = new EventList.Builder();
|
||||
|
||||
/** The max concurrency. */
|
||||
private int rowCount = -1;
|
||||
@@ -70,9 +71,16 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
||||
* @param evt the evt
|
||||
*/
|
||||
public void addEvent(ITxEvent evt) {
|
||||
events.put(evt.getTime(), evt);
|
||||
eventBuilder.add(evt.getTime(), evt);
|
||||
}
|
||||
|
||||
void finishEvents() {
|
||||
if (eventBuilder != null) {
|
||||
events = eventBuilder.build();
|
||||
eventBuilder = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the events.
|
||||
*
|
||||
|
||||
+3
-1
@@ -252,7 +252,9 @@ public class TextDbLoader implements IWaveformDbLoader {
|
||||
} finally {
|
||||
transactions = parser.txSink;
|
||||
}
|
||||
txStreams.values().parallelStream().forEach(TxStream::calculateConcurrency);
|
||||
txStreams.values().forEach(TxStream::finishEvents);
|
||||
txGenerators.values().forEach(TxGenerator::finishEvents);
|
||||
txStreams.values().parallelStream().forEach(TxStream::calculateConcurrency);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user