Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
9587f24
wip
hmottestad Sep 19, 2025
525f172
wip2
hmottestad Sep 19, 2025
49de1c6
wip
hmottestad Sep 19, 2025
04fd3ce
wip
hmottestad Sep 19, 2025
dcef20b
wip
hmottestad Sep 19, 2025
10af1db
wip
hmottestad Sep 19, 2025
906032a
wip
hmottestad Sep 21, 2025
856359f
wip
hmottestad Sep 21, 2025
d0c2a05
wip
hmottestad Sep 21, 2025
c86a0b9
wip
hmottestad Sep 21, 2025
bdb71d9
wip
hmottestad Sep 21, 2025
a904a1a
wip
hmottestad Sep 21, 2025
e83865b
wip
hmottestad Sep 21, 2025
97f2988
wip
hmottestad Sep 21, 2025
25b2013
faster when there are no inferred statements
hmottestad Sep 22, 2025
9d1dbb1
lazy group matcher
hmottestad Sep 22, 2025
3727afa
quick return from group matcher
hmottestad Sep 22, 2025
fc0f08c
quick return from group matcher
hmottestad Sep 22, 2025
c8f94e5
wip
hmottestad Sep 22, 2025
e1be93b
wip
hmottestad Sep 22, 2025
9879f94
wip
hmottestad Sep 22, 2025
3aee65c
wip
hmottestad Sep 22, 2025
d0ef019
wip
hmottestad Sep 22, 2025
ebe76af
wip
hmottestad Sep 23, 2025
f812e6e
wip
hmottestad Sep 23, 2025
60559a7
wip
hmottestad Sep 23, 2025
d8d0676
wip
hmottestad Sep 23, 2025
c563326
wip
hmottestad Sep 23, 2025
0c89bb2
cache keys
hmottestad Sep 23, 2025
45ecb4f
cache keys
hmottestad Sep 23, 2025
a0b1d11
cache keys
hmottestad Sep 23, 2025
af494bb
wip
hmottestad Sep 23, 2025
281ff6f
key cache improvements
hmottestad Sep 23, 2025
a527f7b
key cache improvements
hmottestad Sep 23, 2025
f715fe8
key cache improvements
hmottestad Sep 23, 2025
94e3401
key cache improvements
hmottestad Sep 23, 2025
5d5bc0f
key cache improvements
hmottestad Sep 23, 2025
ca00d3e
key cache improvements
hmottestad Sep 23, 2025
0455be1
key cache improvements
hmottestad Sep 23, 2025
869e428
key cache improvements
hmottestad Sep 23, 2025
533092c
key cache improvements wip
hmottestad Sep 24, 2025
257db63
wip
hmottestad Sep 25, 2025
3a70833
remove key cache
hmottestad Sep 25, 2025
c217b4a
wip
hmottestad Sep 25, 2025
9ac87ed
wip
hmottestad Sep 25, 2025
9a75618
wip
hmottestad Sep 25, 2025
9b1ae31
wip
hmottestad Sep 25, 2025
8ede918
wip
hmottestad Sep 25, 2025
c3f1a98
wip
hmottestad Sep 25, 2025
685568b
wip
hmottestad Sep 25, 2025
d56f995
wip
hmottestad Sep 25, 2025
77c4e88
wip
hmottestad Sep 25, 2025
9a13807
wip
hmottestad Sep 25, 2025
e9010db
wip
hmottestad Sep 25, 2025
20d1a36
wip
hmottestad Sep 25, 2025
a5a2fcf
wip
hmottestad Sep 25, 2025
2cbbf92
wip
hmottestad Sep 26, 2025
b77c1a9
wip
hmottestad Sep 26, 2025
077bd88
wip
hmottestad Sep 26, 2025
d1c8992
wip
hmottestad Sep 26, 2025
c654c51
wip
hmottestad Sep 26, 2025
bd98f9c
wip
hmottestad Sep 26, 2025
67c86a9
test
hmottestad Sep 26, 2025
c5ab948
wip
hmottestad Sep 27, 2025
5b9479a
wip
hmottestad Sep 27, 2025
8a8e1a1
optimising GroupMatcher
hmottestad Sep 27, 2025
3ea2762
optimising GroupMatcher
hmottestad Sep 27, 2025
cbbb904
optimising GroupMatcher
hmottestad Sep 27, 2025
1e88ebe
optimising GroupMatcher
hmottestad Sep 27, 2025
6bdaafa
optimising GroupMatcher
hmottestad Sep 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
619 changes: 253 additions & 366 deletions AGENTS.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import java.util.Iterator;
import java.util.stream.Stream;

import org.eclipse.rdf4j.model.Statement;

/**
* An {@link CloseableIteration} that can be closed to free resources that it is holding. CloseableIterations
* automatically free their resources when exhausted. If not read until exhaustion or if you want to make sure the
Expand All @@ -33,6 +35,8 @@
*/
public interface CloseableIteration<E> extends Iterator<E>, AutoCloseable {

EmptyIteration<Statement> EMPTY_STATEMENT_ITERATION = new EmptyIteration<>();

/**
* Convert the results to a Java 8 Stream.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ public DualUnionIteration(Comparator<E> cmp,
public static <E> CloseableIteration<? extends E> getWildcardInstance(
CloseableIteration<? extends E> leftIteration, CloseableIteration<? extends E> rightIteration) {

if (rightIteration instanceof EmptyIteration) {
if (leftIteration == EMPTY_STATEMENT_ITERATION) {
return rightIteration;
} else if (rightIteration == EMPTY_STATEMENT_ITERATION) {
return leftIteration;
} else if (rightIteration instanceof EmptyIteration) {
return leftIteration;
} else if (leftIteration instanceof EmptyIteration) {
return rightIteration;
Expand All @@ -63,7 +67,11 @@ public static <E> CloseableIteration<? extends E> getWildcardInstance(
public static <E> CloseableIteration<? extends E> getWildcardInstance(Comparator<E> cmp,
CloseableIteration<? extends E> leftIteration, CloseableIteration<? extends E> rightIteration) {

if (rightIteration instanceof EmptyIteration) {
if (leftIteration == EMPTY_STATEMENT_ITERATION) {
return rightIteration;
} else if (rightIteration == EMPTY_STATEMENT_ITERATION) {
return leftIteration;
} else if (rightIteration instanceof EmptyIteration) {
return leftIteration;
} else if (leftIteration instanceof EmptyIteration) {
return rightIteration;
Expand All @@ -75,7 +83,11 @@ public static <E> CloseableIteration<? extends E> getWildcardInstance(Comparator
public static <E> CloseableIteration<E> getInstance(CloseableIteration<E> leftIteration,
CloseableIteration<E> rightIteration) {

if (rightIteration instanceof EmptyIteration) {
if (leftIteration == EMPTY_STATEMENT_ITERATION) {
return rightIteration;
} else if (rightIteration == EMPTY_STATEMENT_ITERATION) {
return leftIteration;
} else if (rightIteration instanceof EmptyIteration) {
return leftIteration;
} else if (leftIteration instanceof EmptyIteration) {
return rightIteration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public abstract class AbstractBindingSet implements BindingSet {

@Override
public boolean equals(Object other) {
if (other == null) {
return false;
}
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,23 @@ public void addAll(ArrayBindingSet other) {

}

// @Override
// public boolean equals(Object other){
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: During GRPUP BY I noticed that ArrayBindingSet could have use for it's own equals method, which can be faster.

We should also look into if hashcode is cached in the super class.

// if(other == null) return false;
// if(other == this) return true;
//
// if(other.getClass() != ArrayBindingSet.class){
// return super.equals(other);
// }
//
// ArrayBindingSet that = (ArrayBindingSet) other;
//
// // TODO make a faster equals for ArrayBindingSet
// return super.equals(that);
//
//
// }

private class ArrayBindingSetIterator implements Iterator<Binding> {

private int index = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class SailDatasetImpl implements SailDataset {

private static final EmptyIteration<Triple> TRIPLE_EMPTY_ITERATION = new EmptyIteration<>();
private static final EmptyIteration<Namespace> NAMESPACES_EMPTY_ITERATION = new EmptyIteration<>();
private static final EmptyIteration<Statement> STATEMENT_EMPTY_ITERATION = new EmptyIteration<>();

/**
* {@link SailDataset} of the backing {@link SailSource}.
Expand Down Expand Up @@ -286,7 +285,7 @@ public CloseableIteration<? extends Statement> getStatements(Resource subj, IRI
} else if (iter != null) {
return iter;
} else {
return STATEMENT_EMPTY_ITERATION;
return CloseableIteration.EMPTY_STATEMENT_ITERATION;
}
}

Expand Down
Loading
Loading