-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement our own iterator for Bucket.Entry: #2196
Conversation
the stream based implementation was surprisingly slow
backend/src/main/java/com/bakdata/conquery/models/events/CBlock.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/bakdata/conquery/models/events/CBlock.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/bakdata/conquery/models/events/CBlock.java
Outdated
Show resolved
Hide resolved
@@ -27,7 +32,7 @@ public CBlock deserialize(JsonParser p, DeserializationContext ctxt) throws IOEx | |||
|
|||
TreeConcept concept = block.getConnector().getConcept(); | |||
|
|||
if(concept != null && block.getMostSpecificChildren() != null) { | |||
if(block.getMostSpecificChildren() != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wenn das Konzept null ist dann tritt ein NullException später in concept.getElementByLocalId
auf.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Das Konzept kann nicht null sein und wenn es null wäre, wäre es ein Fehler, weil wir dann einen CBlock ohne Konztep hätten
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ich habe nur kleine Performance Dinge gesehen, sonst sieht es gut aus 👍
backend/src/main/java/com/bakdata/conquery/models/events/CBlock.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/bakdata/conquery/models/events/CBlock.java
Outdated
Show resolved
Hide resolved
@@ -40,7 +42,9 @@ public void serialize() throws IOException, JSONException { | |||
final Import imp = new Import(table); | |||
imp.setName("import"); | |||
|
|||
final Bucket bucket = new Bucket(0, 0, 10, new ColumnStore[0], Collections.emptySet(),new int[10], new int[10], imp); | |||
concept.initElements(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ist das nötig oder fehlt das einfach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ich verstehe nicht warum es davor geklappt hat, aber es fehlte tatsächlich, der deserializer geht ja über alle elemente drüber und greift dann auf das konzept zu.
…k.java Co-authored-by: MT <12283268+thoniTUB@users.noreply.github.com>
backend/src/main/java/com/bakdata/conquery/models/events/CBlock.java
Outdated
Show resolved
Hide resolved
CDateRange[] spans = new CDateRange[bucketSize]; | ||
|
||
for (int index = 0; index < bucketSize; index++) { | ||
if (mins[index] == Integer.MAX_VALUE && maxs[index] == Integer.MIN_VALUE) { | ||
spans[index] = CDateRange.all(); | ||
continue; | ||
} | ||
|
||
if (mins[index] == Integer.MAX_VALUE) { | ||
spans[index] = CDateRange.atMost(maxs[index]); | ||
continue; | ||
} | ||
|
||
if (maxs[index] == Integer.MAX_VALUE) { | ||
spans[index] = CDateRange.atLeast(mins[index]); | ||
continue; | ||
} | ||
|
||
spans[index] = CDateRange.of(mins[index], maxs[index]); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ich wurde den Loop-Body in eine Methode packen und die dann in der oberen äußeren Loop aufrufen ohne dass dann mins
und maxs
existieren muss.
Ich weiß dass du hier Phase Splitting machst, aber für mich ist das eins zuweit draußen, da die beiden for-loops doch über die selbe Sache iterieren
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moment, es geht nicht nur um Phase-splitting sondern auch darum die allokationen zu sparen. Also ich müsste so oder so split phase machen
…k.java Co-authored-by: MT <12283268+thoniTUB@users.noreply.github.com>
the stream based implementation was surprisingly slow