-
Notifications
You must be signed in to change notification settings - Fork 3k
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 QualifiedName
constructor
#15352
Speed up QualifiedName
constructor
#15352
Conversation
@@ -63,7 +62,7 @@ private QualifiedName(List<Identifier> originalParts) | |||
this.parts = originalParts.stream() | |||
.map(QualifiedName::mapIdentifier) | |||
.collect(toImmutableList()); | |||
this.name = Joiner.on(".").join(parts); | |||
this.name = String.join(".", parts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just a cleanup? Or part of Speed up QualifiedName constructor
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The java version of this is indeed faster, but I don't think faster enough to make a difference. So this is more of a cosmetic change
core/trino-parser/src/main/java/io/trino/sql/tree/QualifiedName.java
Outdated
Show resolved
Hide resolved
Any numbers? |
core/trino-parser/src/main/java/io/trino/sql/tree/QualifiedName.java
Outdated
Show resolved
Hide resolved
The QualifiedName constructor is used for every identifier during analysis phase and may take significant part of wall time for huge queries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -63,7 +62,7 @@ private QualifiedName(List<Identifier> originalParts) | |||
this.parts = originalParts.stream() | |||
.map(QualifiedName::mapIdentifier) | |||
.collect(toImmutableList()); | |||
this.name = Joiner.on(".").join(parts); | |||
this.name = String.join(".", parts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The java version of this is indeed faster, but I don't think faster enough to make a difference. So this is more of a cosmetic change
fce81a2
to
c0d09fa
Compare
Description
A small performance tweak.
I noticed that about 1% of analysis time in some of my huge queries was spent in the constructor of
QualifiedName
in stream logic.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: