Repository navigation
Add an opt-in no_std Rust Runtime API client for Linux - #208
Draft
GradExMachina wants to merge 1 commit into
Draft
GradExMachina wants to merge 1 commit into
GradExMachina wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Hi team! I got curious about the cost of copying large invocation payloads, especially when durable functions replay checkpointed results. I built an opt-in
#![no_std]Rust implementation ofrapid-client.nodeto measure it. The JavaScript runtime and default C++ install are unchanged.This is a draft for discussion. Would the memory savings justify maintaining another transport? I'd also be happy to use these benchmarks to investigate reducing copies in the existing client.
Scope
Linux OCI images. Set
RIC_NATIVE_CLIENT=rustduring installation to build the alternative client with Cargo. There are no changes to the managed runtime build.next()on Node's worker pool and keep buffereddone()anderror()synchronous.httparse, Linux sockets and direct Node-API calls.Local measurements
Linux ARM64, Node 26.13.1, Rust 1.100.1, AWS C++ library and binding built at
-O3, bundled curl at-O2. Medians with alternating client order.Peak memory fell 26% in the replay test. The last event contained 5.5 MiB of checkpointed results. The memory test included JSON parsing and excluded the SDK and mock server. In the live SDK test, transport and JSON took 28% less time. Active time, excluding waits between invocations, fell about 1.5%.
These are warm loopback measurements with all durable state inline. They don't measure cold starts, paginated replay or production Lambda performance. See
test/native/README.mdfor the method and reproduction commands.Verification and review
The native and streaming checks are manual in this draft. Run
npm run test:nativeandnpm run test:streamafter building the bundle and the Rust addon.cargo checkfor x86-64.npm installand tested a local npm tarball. The lockfile was unchanged.The optional build brings a second toolchain and custom HTTP/1.1 framing. The socket lifecycle, allocator and unsafe Node-API boundary need independent review. A panic or unrecoverable allocation failure aborts Node. I would keep this experimental.