Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions quest/m1/ffi-export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 17 additions & 0 deletions quest/m1/ffi-export/moq-checkouts.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions quest/m3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 15 additions & 0 deletions quest/m3/ffi-python-calls.md
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 15 additions & 0 deletions quest/m3/ffi-python-wake.md
Original file line number Diff line number Diff line change
@@ -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.