Skip to content

Extract meaningful methods in join operator#16468

Merged
sopel39 merged 2 commits intotrinodb:masterfrom
skrzypo987:skrzypo/269-extract-meaningful-methods-in-join-operator
Mar 10, 2023
Merged

Extract meaningful methods in join operator#16468
sopel39 merged 2 commits intotrinodb:masterfrom
skrzypo987:skrzypo/269-extract-meaningful-methods-in-join-operator

Conversation

@skrzypo987
Copy link
Copy Markdown
Member

Description

Just a simple refactoring

Additional context and related issues

Release notes

(x) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

skrzypo987 added 2 commits March 9, 2023 10:43
JFR profiling will also be easier when code is split into more methods
@cla-bot cla-bot bot added the cla-signed label Mar 9, 2023
Copy link
Copy Markdown
Member

@lukasz-stec lukasz-stec left a comment

Choose a reason for hiding this comment

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

good idea + lgtm

@skrzypo987
Copy link
Copy Markdown
Member Author

good idea

Just for the record, it was your idea in the first place.

Copy link
Copy Markdown
Member

@sopel39 sopel39 left a comment

Choose a reason for hiding this comment

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

Could this have perf impact? Did JMH change?

// look for an empty slot or a slot containing this key
while (keys[pos] != -1) {
int currentKey = keys[pos];
if (hash == positionToHashes[currentKey] && positionEqualsPositionIgnoreNulls(currentKey, realPosition)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

missing cast?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

hash is now casted in method invocation, line 122

Copy link
Copy Markdown
Member Author

@skrzypo987 skrzypo987 left a comment

Choose a reason for hiding this comment

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

Could this have perf impact? Did JMH change?

It's quite improbable, for two reasons:

  • Those methods are inlined by JIT, if applicable
  • Every extracted method either operates on batch of values or performs multiple random memory accesses. So the methods are not cheap and cost of invocation is negligible.

// look for an empty slot or a slot containing this key
while (keys[pos] != -1) {
int currentKey = keys[pos];
if (hash == positionToHashes[currentKey] && positionEqualsPositionIgnoreNulls(currentKey, realPosition)) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

hash is now casted in method invocation, line 122

@sopel39 sopel39 merged commit 350a361 into trinodb:master Mar 10, 2023
@github-actions github-actions bot added this to the 411 milestone Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants