perf(sidecar): raw-binary readFileSync transfer (skip base64)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, rust
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Bắt đầu với crates/execution/src/v8_runtime.rs:183, crates/execution/assets/v8-bridge.source.js và crates/v8-runtime/src/host_call.rs để lần theo các đường dẫn phản hồi nhị phân hiện có. Kiểm tra các consumer {__agentOsType:"bytes"} khác, sau đó thêm coverage cho các thao tác đọc nhị phân đồng bộ và đọc qua promise, cùng với tính đối xứng của writeFileBinary; hoàn tất nghĩa là các thao tác đọc nhị phân sử dụng đường dẫn raw-binary mà không qua base64.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Background
Guest binary fs.readFileSync(path) (no encoding) goes
_fs.readFileBinary → _fsReadFileBinary → mapped to fs.readFileSync with the
binary flag (crates/execution/src/v8_runtime.rs:183) → host returns the bytes as
a base64-encoded JSON object (javascript_sync_rpc_bytes_value:
{ "__agentOsType": "bytes", "base64": "..." }), and the guest decodes with
Buffer.from(base64, "base64") (crates/execution/assets/v8-bridge.source.js).
So every binary file read pays base64 encode (host) + decode (guest) plus ~33%
payload inflation. The base64 round-trip is wasted work.
Proposal
Transfer file bytes as raw binary instead of base64. The bridge response
protocol already has a raw-binary path (status = 2 / Uint8Array, see
crates/v8-runtime/src/host_call.rs). Route readFileSync's binary result through
that path and have the guest do Buffer.from(uint8array) directly.
Why it wasn't done in PR #77
The sync-RPC return type is a serde_json::Value, which can't carry raw bytes —
hence the base64 representation. Switching readFileSync to the status=2
raw-binary response is a cross-cutting protocol change that affects every
binary file read, so it was deferred rather than rushed (read was already 6.2×
faster from the pump fix in #77). Needs careful implementation + tests for:
binary readFile (sync + promises), writeFileBinary symmetry, and the
{__agentOsType:"bytes"} consumers elsewhere.
Expected impact
Removes base64 encode/decode + ~33% payload inflation per binary read; helps
read-heavy guests (bundlers, asset pipelines, large node_modules).
- Ngôn ngữ chính
- TypeScript
- Star
- 1k
- Fork
- 53
- Merge trung bình
- 2 giờ 54 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rivet-dev/dynamic-apps
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
rivet-dev/dynamic-apps#305 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
rivet-dev/dynamic-apps#306 ·
-
Build cache ignores maxResponseBytes, potentially reusing an outdated response limitCó thể đã có người làm @Utkarshpandey0001 đã nhận 44 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
rivet-dev/dynamic-apps#297 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
rivet-dev/dynamic-apps#280 · 2 bình luận ·
-
Make agentOS runtime classifier content-based (match Linux exec semantics), not extension-basedCó thể đã có người làm @mittal-parth đã nhận 49 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
rivet-dev/dynamic-apps#275 ·
Tất cả issue của rivet-dev/dynamic-apps
Issue tương tự
-
Add API: BlockVectra Data APIĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
remotion-dev/remotion#12905 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
supermomonga/paseo-plugin-zcode-provider#83 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
oxidecomputer/skepsis#102 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
voidzero-dev/void#677 ·
Maintainer thường phản hồi trong vòng 1 ngày