Skip to content

perf(rust): pre-compute metadata and optimize WASM binary size#115

Open
codetiger wants to merge 3 commits intoopen-feature-forking:mainfrom
codetiger:perf/precompute-metadata-and-wasm-size
Open

perf(rust): pre-compute metadata and optimize WASM binary size#115
codetiger wants to merge 3 commits intoopen-feature-forking:mainfrom
codetiger:perf/precompute-metadata-and-wasm-size

Conversation

@codetiger
Copy link
Copy Markdown

Summary

  • docs: Update datalogic-rs repository URL from cozylogic to GoPlasmatic org
  • build: Optimize release profile for WASM binary size (opt-level = "z", codegen-units = 1) — reduces WASM binary from 2.59 MB to 1.97 MB (~24% smaller)
  • perf: Pre-compute merged metadata at parse time and store in Arc for cheap cloning, use Cow<str> in resolve_string_from_context to avoid allocations, remove global OnceLock singleton in favor of reusing the evaluator's DataLogic engine, and use entry API with pre-allocated maps

Test plan

  • All existing tests pass (cargo test)
  • Benchmarked native performance: no meaningful regression (all changes within ±3% noise)
  • WASM binary size verified: 2.59 MB → 1.97 MB (23.9% reduction)

…ion allocations

- Pre-merge flag-set and flag-level metadata during parsing, store in Arc for cheap cloning
- Use Cow<str> in resolve_string_from_context to avoid string allocations
- Remove global OnceLock singleton, reuse evaluator's DataLogic engine for parsing
- Use entry API and pre-allocated maps to reduce hash lookups
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant