Skip to content

Commit 62b4e61

Browse files
Copilotmax-lt
andcommitted
Add concise code pointers to docs for LLM navigation
Co-authored-by: max-lt <9805205+max-lt@users.noreply.github.com>
1 parent 694d673 commit 62b4e61

4 files changed

Lines changed: 36 additions & 5 deletions

File tree

docs/architecture.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,16 @@ platform.rs ← V8 Platform (singleton, once per process)
3030

3131
## Execution Modes
3232

33-
| Mode | API | Performance | Use Case |
34-
| ----------------- | ------------------ | -------------- | -------------------- |
35-
| **Legacy** | `Worker::new()` | Slow (~ms/req) | Max isolation, tests |
36-
| **Shared Pool** | `execute_pooled()` | Fast (~µs/req) | Multi-thread |
37-
| **Thread-Pinned** | `execute_pinned()` | Fastest | **Production** |
33+
| Mode | API | Performance | Use Case |
34+
| ----------------- | ------------------ | -------------- | ------------------------ |
35+
| **Legacy** | `Worker::new()` | Slow (~ms/req) | Max isolation, tests |
36+
| **Shared Pool** | `execute_pooled()` | Fast (~µs/req) | Multi-thread, production |
37+
| **Thread-Pinned** | `execute_pinned()` | Fastest | Multi-tenant, no lock |
38+
39+
**Code pointers:**
40+
- `execute_pooled()``pooled_execution.rs` (uses `isolate_pool.rs`)
41+
- `execute_pinned()``thread_pinned_pool.rs`
42+
- `Worker``worker.rs`
3843

3944
See [execution_modes.md](./execution_modes.md) for details.
4045

docs/execution_modes.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,12 @@ Legacy code using SharedIsolate? → Keep it (but migrate)
131131
| Thread-Pinned | `Mutex` (local) | Zero cross-thread |
132132

133133
V8 isolates are **not thread-safe**. `v8::Locker` provides mutual exclusion at the V8 level—required for any cross-thread sharing.
134+
135+
## Code Pointers
136+
137+
| Mode | Entry point | Implementation |
138+
| ------------- | -------------------- | ---------------------------- |
139+
| Worker | `Worker::new()` | `worker.rs` |
140+
| IsolatePool | `execute_pooled()` | `pooled_execution.rs``isolate_pool.rs` |
141+
| Thread-Pinned | `execute_pinned()` | `thread_pinned_pool.rs` |
142+
| SharedIsolate | `ExecutionContext::new()` | `execution_context.rs` + `shared_isolate.rs` |

docs/isolate_pool.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,12 @@ Rust compiler prevents:
183183
- Sending Locker to another thread
184184
- Using isolate without Locker
185185
- Locker outliving its scope
186+
187+
## Code Pointers
188+
189+
| Component | File | Key functions |
190+
| -------------------- | --------------------------- | --------------------------------- |
191+
| Pool singleton | `isolate_pool.rs` | `init_pool()`, `get_pool()` |
192+
| Pool entry point | `pooled_execution.rs` | `execute_pooled()` |
193+
| Isolate wrapper | `locker_managed_isolate.rs` | `LockerManagedIsolate::new()` |
194+
| Execution context | `execution_context.rs` | `new_with_pooled_isolate()` |

docs/streams.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,11 @@ while (true) {
149149
- `Bytes` uses reference counting (zero-copy)
150150
- Receivers removed during `read_chunk()` to prevent deadlock
151151
- Auto-cleanup on `Done` or `Error`
152+
153+
## Code Pointers
154+
155+
| Component | File | Key functions |
156+
| -------------- | --------------------------- | -------------------------------------- |
157+
| StreamManager | `runtime/stream_manager.rs` | `create_stream()`, `write_chunk()`, `read_chunk()` |
158+
| JS bindings | `runtime/bindings/streams.rs` | `__nativeStreamRead()` |
159+
| Scheduler | `runtime/scheduler.rs` | `SchedulerMessage::StreamRead` |

0 commit comments

Comments
 (0)