diff --git a/quest/m1/ffi-export/README.md b/quest/m1/ffi-export/README.md index ebe0f1ebd..b96be5f8e 100644 --- a/quest/m1/ffi-export/README.md +++ b/quest/m1/ffi-export/README.md @@ -60,3 +60,4 @@ than `ctypes`; the others call C natively. moq's packages switch to them in moq' - [Python bindings](/quest/m1/ffi-export/python.md) - a generated CPython extension, skipping the C ABI as Kotlin's JNI does - [Go bindings](/quest/m1/ffi-export/go.md) - Go over the C ABI through cgo - [Dart bindings](/quest/m1/ffi-export/dart.md) - Dart over the C ABI through `dart:ffi` +- [A moq checkout per pin](/quest/m1/ffi-export/moq-checkouts.md) - `just ts` and `just ffi` check out their own moq revisions, so both run at once diff --git a/quest/m1/ffi-export/moq-checkouts.md b/quest/m1/ffi-export/moq-checkouts.md new file mode 100644 index 000000000..6c014508f --- /dev/null +++ b/quest/m1/ffi-export/moq-checkouts.md @@ -0,0 +1,17 @@ +# [S] A moq checkout per pin + +## Goal + +`just ts` and `just ffi` each check out the moq revision they pin in a directory of its own, +so running both at once in one worktree, such as `just ci` beside `just ffi bench`, builds +each against its own revision. + +## Plan + +Found by [#407](https://github.com/moq-dev/rust2/pull/407): `just ffi standin` reads +`ts/target/moq`, which `just ts moq-pin` checks out at ts's revision, and the two pins have +differed since [#397](https://github.com/moq-dev/rust2/pull/397). Running both at once fails +the export with a missing crate. Key the checkout by its revision, or give ffi its own, +sharing the clone's objects rather than fetching twice. + +Public API: none. diff --git a/quest/m3/README.md b/quest/m3/README.md index 30a2c85d5..f152025b4 100644 --- a/quest/m3/README.md +++ b/quest/m3/README.md @@ -40,3 +40,5 @@ generic std gap is planned here even when moq never calls it. - [An Option of numbers in the result slot](/quest/m3/ts-option-slot.md) - `varint_opt`'s `Option` comes back through the slot with no object per call - [Dropping a crate's generic type inside another](/quest/m3/ts-nested-generic-drop.md) - an `LruCache` holding a `LinkedHashMap` drops as rustc's glue does - [Fresh writes through a zip, a copy, and a repeat](/quest/m3/ts-fresh-shapes.md) - zipping a `Vec<[T; N]>`, reading a `T` out of `Zip::next`, and `copied` or `vec![x; n]` over a `Copy` type translate +- [Python's wake on the loop's own thread](/quest/m3/ffi-python-wake.md) - a wake on the event loop's thread resumes the future with no socket pair +- [Python's call cost](/quest/m3/ffi-python-calls.md) - a call on an object costs what BoltFFI's does, or the gap is explained diff --git a/quest/m3/ffi-python-calls.md b/quest/m3/ffi-python-calls.md new file mode 100644 index 000000000..eea76cd79 --- /dev/null +++ b/quest/m3/ffi-python-calls.md @@ -0,0 +1,15 @@ +# [M] Python's call cost + +## Goal + +A call on an object through the exporter's [Python](/ffi/README.md) costs what +[BoltFFI's](/bench/ffi/README.md#boltffi-comparison) does, 63 ns, or `just ffi bench` +explains the gap. + +## Plan + +Found by [#407](https://github.com/moq-dev/rust2/pull/407), which measured about 125 ns on a +loaded host. Measure on a quiet one first, then profile where the extension spends the rest: +argument parsing, the handle's lookup, and the contract or GIL work per call. + +Public API: none. diff --git a/quest/m3/ffi-python-wake.md b/quest/m3/ffi-python-wake.md new file mode 100644 index 000000000..58ad5b613 --- /dev/null +++ b/quest/m3/ffi-python-wake.md @@ -0,0 +1,15 @@ +# [S] Python's wake on the loop's own thread + +## Goal + +A future the exporter's [Python](/ffi/README.md) awaits resumes directly when Rust wakes it +on the event loop's own thread, skipping the socket pair, and `just ffi bench` measures the +woken read against [BoltFFI's](/bench/ffi/README.md#boltffi-comparison) 10 µs. + +## Plan + +Found by [#407](https://github.com/moq-dev/rust2/pull/407): a woken read costs about 21 µs, +about 5 of them the socket pair's write and read. A wake from another thread still goes +through it, and the wake-latch and cancel tests keep passing. + +Public API: none.