BoundaryML
baml
BlogDocsChangelog

refactor(vm): extract baml_vm_types crate to decouple compiler from runtime

#2959Merged
Comparing
hellovai/baml_vm_types
(
edb2d62
) with
canary
(
e98ffe2
)
CodSpeed Performance Gauge
-1%
Untouched
15
Skipped
35

Benchmarks

Skipped (35)

Passed

bench_incremental_add_field
crates/baml_tests/benches/compiler_benchmark.rs
CodSpeed Performance Gauge
0%
48.3 µs48.1 µs
bench_scale_deep_nesting
/home/runner/work/baml/baml/baml_language/target/release/build/baml_tests-f46e39c20c9ddb46/out/generated_benchmarks.rs
CodSpeed Performance Gauge
0%
426.2 µs425.1 µs
bench_incremental_modify_function
crates/baml_tests/benches/compiler_benchmark.rs
CodSpeed Performance Gauge
0%
56.5 µs56.5 µs
bench_incremental_rename_type
/home/runner/work/baml/baml/baml_language/target/release/build/baml_tests-f46e39c20c9ddb46/out/generated_benchmarks.rs
CodSpeed Performance Gauge
0%
222.1 µs222.3 µs
bench_scale_100_functions
/home/runner/work/baml/baml/baml_language/target/release/build/baml_tests-f46e39c20c9ddb46/out/generated_benchmarks.rs
CodSpeed Performance Gauge
0%
742.9 µs744.5 µs
bench_incremental_add_new_file
crates/baml_tests/benches/compiler_benchmark.rs
CodSpeed Performance Gauge
-1%
57.4 µs57.7 µs
bench_incremental_add_attribute
/home/runner/work/baml/baml/baml_language/target/release/build/baml_tests-f46e39c20c9ddb46/out/generated_benchmarks.rs
CodSpeed Performance Gauge
-1%
50.7 µs51.1 µs
bench_single_simple_file
crates/baml_tests/benches/compiler_benchmark.rs
CodSpeed Performance Gauge
-1%
59.2 µs59.8 µs
bench_parse_only_simple
crates/baml_tests/benches/compiler_benchmark.rs
CodSpeed Performance Gauge
-1%
57.7 µs58.3 µs
bench_empty_project
crates/baml_tests/benches/compiler_benchmark.rs
CodSpeed Performance Gauge
-1%
32.3 µs32.7 µs
bench_incremental_add_user_field
/home/runner/work/baml/baml/baml_language/target/release/build/baml_tests-f46e39c20c9ddb46/out/generated_benchmarks.rs
CodSpeed Performance Gauge
-2%
154.6 µs157.2 µs
bench_incremental_close_string
/home/runner/work/baml/baml/baml_language/target/release/build/baml_tests-f46e39c20c9ddb46/out/generated_benchmarks.rs
CodSpeed Performance Gauge
-2%
68 µs69.3 µs
bench_incremental_add_string_char
/home/runner/work/baml/baml/baml_language/target/release/build/baml_tests-f46e39c20c9ddb46/out/generated_benchmarks.rs
CodSpeed Performance Gauge
-2%
50.1 µs51.4 µs
bench_incremental_no_change
crates/baml_tests/benches/compiler_benchmark.rs
CodSpeed Performance Gauge
-3%
19.1 µs19.6 µs
bench_lexer_only_simple
crates/baml_tests/benches/compiler_benchmark.rs
CodSpeed Performance Gauge
-3%
33.1 µs34.1 µs

Commits

Click on a commit to change the comparison range
Base
canary
e98ffe2
-0.01%
refactor(vm): extract baml_vm_types crate to decouple compiler from runtime Create new baml_vm_types crate containing: - Bytecode and Instruction definitions (617+ instructions) - Program<T> struct generic over native function bindings - Value, Object, Function, Class, Enum types - Type-safe pool indexing (ObjectPool, GlobalPool, Index<K>) - Jump table data structures for O(1) match dispatch Key architectural changes: - baml_compiler_emit now depends only on baml_vm_types, not baml_vm - Compiler emits Program<()> with unbound native function stubs - VM binds native functions at construction: Program<()> → Program<NativeFunction> - New attach_builtins() resolves native function names to implementations Benefits: - Compiled programs are now serializable (no function pointers) - Enables shipping pre-compiled bytecode in inlined_baml - Reduces code-gen: runtime loads bytecode instead of regenerating - Cleaner separation between compilation and execution BREAKING: Vm::from_program() now returns Result<Vm, VmError> since native function binding can fail if a builtin is not found.
3db910b
3 days ago
by hellovai
+0.31%
fixed doc link errors
98cdd27
3 days ago
by hellovai
-1.36%
Merge branch 'canary' into hellovai/baml_vm_types
edb2d62
3 days ago
by hellovai
© 2026 CodSpeed Technology
Home Terms Privacy Docs