Skip to content
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

Merged
merged 10 commits into from
Nov 16, 2021

Conversation

awildturtok
Copy link
Collaborator

the stream based implementation was surprisingly slow

the stream based implementation was surprisingly slow
@awildturtok awildturtok requested a review from thoniTUB November 8, 2021 08:48
@@ -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) {
Copy link
Contributor

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.

Copy link
Collaborator Author

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

thoniTUB
thoniTUB previously approved these changes Nov 10, 2021
Copy link
Collaborator

@thoniTUB thoniTUB left a 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 👍

@@ -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();
Copy link
Collaborator

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?

Copy link
Collaborator Author

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>
Comment on lines 337 to 358
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]);
}


Copy link
Collaborator

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

Copy link
Collaborator Author

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>
@awildturtok awildturtok requested a review from thoniTUB November 16, 2021 16:02
@awildturtok awildturtok merged commit a44c909 into develop Nov 16, 2021
@delete-merged-branch delete-merged-branch bot deleted the feature/bucket-iterator branch November 16, 2021 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants