Skip to content

Conversation

@andreitokar
Copy link
Contributor

Supposedly there is no functional changes, apart from support for byte[] as keys and Integers as keys / values in MVMap (not used by H2).

/**
* Get the value of the specified user defined variable. This method always
* returns a value; it returns ValueNull.INSTANCE if the variable doesn't
* returns a value; it returns ValueNull. INSTANCE if the variable doesn't
Copy link
Contributor

@katzyn katzyn Jan 6, 2025

Choose a reason for hiding this comment

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

{@code ValueNull.INSTANCE} or {@linkplain ValueNull#INSTANCE} to avoid such formatting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I suppose to read it first 😢

}
x = (low + high) >>> 1;
}
return -(low + 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

~low

Copy link
Contributor

Choose a reason for hiding this comment

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

I just retested it with JMH on Java 21 / x86_64, ~ is still faster like in older versions of Java.


@Override
public int compare(byte[] one, byte[] two) {
return Arrays.compare(one, two);
Copy link
Contributor

Choose a reason for hiding this comment

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

H2 uses Arrays.compareUnsigned() for binary string data types, but octets in SQL and bytes in Java aren't exactly the same thing.

Anyway, it is possible to write a custom data type for MVStore with any comparison rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Either way I could care less, it is mostly for benchmark testing and comparison with other stores

@andreitokar andreitokar merged commit cc0e453 into h2database:master Jan 8, 2025
2 checks passed
@andreitokar andreitokar deleted the code-cleanup branch January 8, 2025 02:55
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.

2 participants