Reuse the compiled provider across runs#592
Draft
dnagoda wants to merge 1 commit into
Draft
Conversation
This was referenced Jul 6, 2026
Batch mode reuses the loaded function module, but Javy/provider functions still recompiled the embedded standard provider for every input row, so provider setup dominated batch runtime. Store the compiled provider Module on Provider and compile it once when the ValidatedModule is built. FunctionRunParams now carries a ValidatedModule (built once in main), so single and batch runs reuse the already-compiled function and provider modules and per-row work is just instantiation. This drops the separate CompiledProvider type, the parallel *_with_compiled_provider entry points, and the per-row Module::from_binary fallback. Add batch coverage for a Javy v3 function to exercise the provider path. Measured locally: 5,000 js_function_javy_plugin_v3 rows complete in ~1.2s, versus ~52s when the provider was recompiled per input row. Verified with: - cargo test - cargo build --release Assisted-By: devx/c659e918-9568-4750-b122-e3890447348a
a8174bb to
9d39117
Compare
388e7a4 to
3e431cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📚 Stack (bottom → top)
--batch-full-outputopt-inWhy
Batch mode already reuses the loaded function module, but Javy/provider
functions still recompiled the embedded standard provider for every input
row. At scale, provider compilation dominated batch runtime.
What
ModuleonProviderand compile it once,when the
ValidatedModuleis built.FunctionRunParamsnow carries aValidatedModule(built once inmain), sosingle and batch runs reuse the already-compiled function and provider
modules — per-row work is just instantiation.
CompiledProvidertype, the parallel*_with_compiled_providerentry points, and the per-rowModule::from_binaryfallback.Performance
Measured locally: 5,000
js_function_javy_plugin_v3rows complete in~1.2s, versus ~52s when the provider was recompiled per input row.
Testing
cargo testcargo build --release