Commit a532f6a
authored
Add `streaming_channels` criterion bench measuring the per-event cost
of the producer/consumer hand-off the FFI streaming surface pays for
every FPSS event delivered to a buffered consumer. Five variants:
- `std_mpsc_unbounded` — current live shape (`std::sync::mpsc::channel()`
+ `recv_timeout(100ms)` poll).
- `crossbeam_bounded_{256,1024,8192}` — lock-free SPSC candidate at
three capacity points covering the proposed backpressure range.
- `direct_callback` — no channel; producer invokes an `extern "C" fn`
through a `Box<dyn Fn>` trampoline, modelling the C/C++ tier-1 path.
Payload mirrors `ffi::streaming::FfiBufferedEvent` field-for-field:
`#[repr(C)]` tagged event with `TdxContract` embedded in every data
variant plus two heap-owned tails (`Option<CString>` + `Option<Vec<u8>>`).
Sizes match the generated `fpss_event_structs.rs` byte-for-byte
(Event = 448 B, BufferedEvent = 488 B on x86_64).
`crossbeam-channel` is added to dev-dependencies only so the runtime
dep graph is unchanged. The implementation switch ships in a follow-up
PR after we read the numbers.
1 parent dc1ccc5 commit a532f6a
3 files changed
Lines changed: 468 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
121 | 127 | | |
122 | 128 | | |
123 | 129 | | |
| |||
154 | 160 | | |
155 | 161 | | |
156 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
157 | 167 | | |
158 | 168 | | |
159 | 169 | | |
| |||
0 commit comments