Skip to content

Commit eb939b1

Browse files
committed
Performance improvements & Updated Python API
1 parent dc56d3e commit eb939b1

54 files changed

Lines changed: 8081 additions & 1448 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exclude = [
1212
]
1313

1414
[workspace.package]
15-
version = "0.1.15"
15+
version = "0.2.0"
1616
edition = "2021"
1717
license = "MIT"
1818
authors = ["polyglot contributors"]

Makefile

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
build-ffi build-ffi-static generate-ffi-header build-ffi-example clean-ffi \
1313
develop-python test-python build-python typecheck-python \
1414
python-docs-build python-docs-preview python-docs-deploy \
15-
bench-compare bench-rust bench-rust-parsing-report bench-python bench-parse bench-parse-quick bench-parse-full bench-simple bench-simple-full \
15+
bench-compare bench-rust bench-rust-parsing-report bench-python bench-parse bench-parse-quick bench-parse-full bench-simple bench-simple-full bench-transpile bench-transpile-quick \
1616
playground-dev playground-build playground-preview playground-deploy \
1717
fmt \
1818
bump-version
@@ -81,6 +81,8 @@ help:
8181
@echo " make bench-parse-full - Parse benchmark (all available parsers)"
8282
@echo " make bench-simple - Simple parse benchmark (core-only, median-of-5)"
8383
@echo " make bench-simple-full - Simple parse benchmark (all available parsers)"
84+
@echo " make bench-transpile - Transpile benchmark (polyglot vs sqlglot)"
85+
@echo " make bench-transpile-quick - Transpile benchmark fast mode"
8486
@echo ""
8587
@echo "Build:"
8688
@echo " make generate-bindings - Generate TypeScript bindings (ts-rs) and copy to SDK"
@@ -344,15 +346,29 @@ bench-parse-full:
344346
@uv sync --project tools/bench-compare --reinstall-package polyglot-sql && \
345347
uv run --project tools/bench-compare python3 tools/bench-compare/bench_parse.py --quiet
346348

349+
# Simple parse benchmark (core), w/o rebuilding the Python environment: polyglot-sql vs sqlglot, median-of-5
350+
bench-simple-quick:
351+
@uv run --project tools/bench-compare python3 tools/bench-compare/bench_simple.py --core-only
352+
347353
# Simple parse benchmark (core): polyglot-sql vs sqlglot, median-of-5
348354
bench-simple:
349355
@uv sync --project tools/bench-compare --reinstall-package polyglot-sql && \
350-
uv run --python 3.13 --project tools/bench-compare python3 tools/bench-compare/bench_simple.py --core-only
356+
uv run --project tools/bench-compare python3 tools/bench-compare/bench_simple.py --core-only
351357

352358
# Simple parse benchmark (full): include optional third-party parsers
353359
bench-simple-full:
354360
@uv sync --project tools/bench-compare --reinstall-package polyglot-sql && \
355-
uv run --python 3.13 --project tools/bench-compare python3 tools/bench-compare/bench_simple.py
361+
uv run --project tools/bench-compare python3 tools/bench-compare/bench_simple.py
362+
363+
# Transpile benchmark: polyglot-sql (Rust/PyO3) vs sqlglot (C tokenizer) via pyperf
364+
bench-transpile:
365+
@uv sync --project tools/bench-compare --reinstall-package polyglot-sql && \
366+
uv run --project tools/bench-compare python3 tools/bench-compare/bench_transpile.py --quiet
367+
368+
# Transpile benchmark (quick): faster but less stable timings
369+
bench-transpile-quick:
370+
@uv sync --project tools/bench-compare --reinstall-package polyglot-sql && \
371+
uv run --project tools/bench-compare python3 tools/bench-compare/bench_transpile.py --quiet --quick
356372

357373
# =============================================================================
358374
# Build

0 commit comments

Comments
 (0)