Skip to content

Remove begin/end token iterators from ASTLiteral as it used only for highlighting and VALUES parsing - #93974

Merged
qoega merged 10 commits into
masterfrom
ast-literal-removebeginend2
Feb 2, 2026
Merged

qoega merged 10 commits into
masterfrom
ast-literal-removebeginend2

Conversation

@qoega

@qoega qoega commented Jan 12, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Performance Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Improve memory footprint of ASTLiteral by removing std::optional begin/end from object. Optimization makes sense as fields are not used when highlighting is not used and there is no VALUES parsing.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Potentially better implementation than #93785

Screenshot 2026-01-09 at 09 49 55

Version info

  • Merged into: 26.2.1.160

@clickhouse-gh

clickhouse-gh Bot commented Jan 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [ac13f9c]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_debug, distributed plan, s3 storage, parallel) error

@clickhouse-gh clickhouse-gh Bot added the pr-performance Pull request with some performance improvements label Jan 12, 2026
@qoega
qoega marked this pull request as ready for review January 13, 2026 08:54
@Algunenano Algunenano self-assigned this Jan 26, 2026

@Algunenano Algunenano left a comment

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.

Minor comments. Really nice to remove these fields

Comment thread src/Parsers/ExpressionListParsers.cpp Resolved
@qoega
qoega force-pushed the ast-literal-removebeginend2 branch 2 times, most recently from ce51f94 to c7e27ee Compare January 28, 2026 20:16
@clickhouse-gh clickhouse-gh Bot added the submodule changed At least one submodule changed in this PR. label Jan 28, 2026
@qoega
qoega force-pushed the ast-literal-removebeginend2 branch 2 times, most recently from c999ddc to cafdf08 Compare January 28, 2026 20:44
@qoega qoega removed the submodule changed At least one submodule changed in this PR. label Jan 28, 2026
@alexey-milovidov alexey-milovidov added memory When memory usage is higher than expected and removed memory-footprint-reduction labels Jan 29, 2026
qoega added 10 commits January 29, 2026 11:19
- Use stack allocation with SCOPE_EXIT instead of std::optional for LiteralTokenMap
- Remove useless ASTQueryParameter/ASTIdentifier check
- Improve comment about extracting token info before cloning
@qoega
qoega force-pushed the ast-literal-removebeginend2 branch from cafdf08 to ac13f9c Compare January 29, 2026 10:24
@Algunenano

Copy link
Copy Markdown
Member

@qoega If you force push you kill all the previous progress reviewing the PR (GH won't remember reviewed files and changers). Also, what's the point if you still have commits with fix and wip?

@qoega

qoega commented Jan 29, 2026

Copy link
Copy Markdown
Member Author

We had recommended git pull --rebase for a while. I already forgot the reason, but it could break the history (first-parent) if done otherwise. So to resolve conflicts I just had to rebase.
Sorry, that github is not that user friendly and can't understand that diff was the same..

@Algunenano

Copy link
Copy Markdown
Member

We had recommended git pull --rebase for a while. I already forgot the reason, but it could break the history (first-parent) if done otherwise. So to resolve conflicts I just had to rebase.

Rebasing has multiple problems: It confuses the private sync, often leading to complex merges or having to redo the work done there, and it breaks the review workflow. You can merge master instead.

@qoega

qoega commented Jan 29, 2026

Copy link
Copy Markdown
Member Author

It is fun how ~4 years ago it was other way around. merge was. confusing our CI scripts and could break changelog generation etc.
Anyway, do you see anything else to address?

@qoega
qoega enabled auto-merge February 2, 2026 13:06
@qoega
qoega added this pull request to the merge queue Feb 2, 2026
Merged via the queue into master with commit 5c363d4 Feb 2, 2026
129 of 130 checks passed
@qoega
qoega deleted the ast-literal-removebeginend2 branch February 2, 2026 13:36
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

memory When memory usage is higher than expected pr-performance Pull request with some performance improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants