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

Speed up AbstractRow.equals() and hashCode() when comparing with other AbstractRow #14747

Closed
lukaseder opened this issue Mar 2, 2023 · 3 comments

Comments

@lukaseder
Copy link
Member

Interestingly, AbstractRow and its many subtypes don't override AbstractQueryPart::hashCode and AbstractQueryPart::equals, so the default applies, which is never good (see #11126):

image

Let's see what a benchmark yields.

@lukaseder
Copy link
Member Author

Curiously, FieldsImpl does override the methods, since #6804

@lukaseder
Copy link
Member Author

Before

Benchmark                     Mode  Cnt        Score      Error  Units
EqualsHashCode.equalsRow     thrpt    7   789568.901 ┬▒ 1049.829  ops/s
EqualsHashCode.hashCodeRow   thrpt    7  1552855.673 ┬▒ 3953.645  ops/s
EqualsHashCode.notEqualsRow  thrpt    7   775447.660 ┬▒ 1521.801  ops/s

After:

Benchmark                     Mode  Cnt         Score         Error  Units
EqualsHashCode.equalsRow     thrpt    7  78137407.459 ┬▒ 3762165.599  ops/s
EqualsHashCode.hashCodeRow   thrpt    7  92974042.394 ┬▒  827003.424  ops/s
EqualsHashCode.notEqualsRow  thrpt    7  73434078.381 ┬▒ 1917341.050  ops/s

Clearly, a huge win.

lukaseder added a commit that referenced this issue Mar 2, 2023
lukaseder added a commit that referenced this issue Mar 2, 2023
lukaseder added a commit that referenced this issue Mar 2, 2023
@lukaseder
Copy link
Member Author

Fixed in jOOQ 3.18.0, 3.17.9 (#14748), and 3.16.15 (#14749)

3.18 Other improvements automation moved this from To do to Done Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

1 participant