Skip to content

Reduce runtime dependency footprint#346

Merged
KKould merged 1 commit into
mainfrom
reduce-runtime-dependency-footprint
Jun 4, 2026
Merged

Reduce runtime dependency footprint#346
KKould merged 1 commit into
mainfrom
reduce-runtime-dependency-footprint

Conversation

@KKould
Copy link
Copy Markdown
Member

@KKould KKould commented Jun 4, 2026

What problem does this PR solve?

Reduce the runtime dependency footprint and release binary size for the normal Rust ORM example path.

Issue link:

What is changed and how it works?

  • Disable default RocksDB crate features and keep only bindgen-runtime, avoiding optional compression feature activation from snappy, lz4, zstd, zlib, and bzip2.
  • Remove the direct regex dependency from KiteSQL runtime code.
  • Replace regex-based TRIM evaluation with direct prefix/suffix trimming.
  • Replace regex-based SQL LIKE evaluation with a small wildcard matcher supporting %, _, escape characters, full-string matching, and Unicode char boundaries.
  • Add focused tests for trim modes and LIKE edge cases.

Size checks from the hello_world ORM release example:

Backend/features Command Release file .text Stripped file
RocksDB cargo bloat --release --example hello_world --features orm --crates -n 20 20.8MiB 12.8MiB ~16.0MiB
LMDB-only cargo bloat --release --example hello_world --no-default-features --features orm,lmdb --crates -n 20 11.5MiB 6.7MiB ~8.6MiB

Regex crates no longer appear in the runtime bloat output.

Code changes

  • Has Rust code change
  • Has CI related scripts change

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Manual test steps:

  • cargo fmt --all -- --check
  • cargo test --lib --features orm
  • cargo run -p sqllogictest-test -- --path tests/slt/filter.slt
  • cargo tree --features orm -e normal -i regex
  • cargo bloat --release --example hello_world --features orm --crates -n 20
  • cargo bloat --release --example hello_world --no-default-features --features orm,lmdb --crates -n 20

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Note for reviewer

The new LIKE matcher intentionally uses SQL full-string matching semantics. Existing filter sqllogictest coverage passes, and unit tests include escape, wildcard, repeated-percent, empty-string, and Unicode cases.

@KKould KKould self-assigned this Jun 4, 2026
@KKould KKould added the enhancement New feature or request label Jun 4, 2026
@KKould KKould merged commit ef9a534 into main Jun 4, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant