apache / apache/datafusion-sqlparser-rs

Improve performance by reducing string copies

オープン
#2,036 コメント 15 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
3.5k
フォーク
772
平均マージ
4日 9時間
マージ済み PR(30日)
17

説明

@Omega359 [mentioned in discord](https://discord.com/channels/885562378132000778/1344430130252218439/1415763431516278794) a blog post by the Databend folks about how they wrote a replacement of sqlparser-rs for their system

https://www.databend.com/blog/category-engineering/2025-09-10-query-parser/

Image

One thing they cite is the fact that sqlparser-rs often copies strings, even when this could be avoided

If anyone cares, we can probably avoid copying strings, someone just has to care enough to thread the lifetime information through all the tokens (or maybe use an Arc w/ an offset)

@AdamGS mentioned he might be interested in trying this

This could possibly be related to another ticket here:
- https://github.com/apache/datafusion-sqlparser-rs/issues/1558

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まずリンク先のDatabendブログ記事と関連するissue #1558を読み、その後lexerとtokenの所有権の経路を調べて、文字列がどこでコピーされているかを特定します。回避可能な文字列コピーを削減し、parserの動作を維持したうえで、プロジェクト既存のテストまたはベンチマークを使ってパフォーマンスへの影響を検証できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
compilers
issue の種類
リファクタリング
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。