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

[SPARK-48568][SQL] Improve Performance of CodeFormatter #49261

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anton-erofeev
Copy link

What changes were proposed in this pull request?

Replace scala StringBuilder with java StringBuilder

Why are the changes needed?

https://issues.apache.org/jira/browse/SPARK-48568

Does this PR introduce any user-facing change?

No

How was this patch tested?

Pass github actions

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Dec 21, 2024
@HyukjinKwon
Copy link
Member

Can we have a micro benchmark?

@LuciferYang
Copy link
Contributor

Can we have a micro benchmark?

+1 for micro benchmark. StringBuilder wraps j.l.StringBuilder,

final class StringBuilder(val underlying: java.lang.StringBuilder) extends AbstractSeq[Char]
  with ReusableBuilder[Char, String]
  with IndexedSeq[Char]
  with IndexedSeqOps[Char, IndexedSeq, StringBuilder]
  with IterableFactoryDefaults[Char, IndexedSeq]
  with java.lang.CharSequence
  with Serializable 

the functions should all directly operate on the underlying, so I'm not sure if this really brings a performance improvement. If it does, is this the only place worth change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants