Skip to content

Commit

Permalink
fixed bottleneck in tuple.equals
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Jan 8, 2024
1 parent 22f2294 commit c6d5900
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@ public boolean equals(@Nullable Object o) {
if (o.getClass() == getClass()) {
Tuple otherTuple = (Tuple) o;

if (getType() != otherTuple.getType()) {
return false;
// checking for the type will dynamically allocate memory
// because tuple types are computed lazily.
// so we skip this "fast failure" check
// if (getType() != otherTuple.getType()) { return false; }

}

IValue[] otherElements = otherTuple.elements;
int nrOfElements = elements.length;
Expand Down

0 comments on commit c6d5900

Please sign in to comment.