You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 655479b
Browse filesBrowse the repository at this point in the historyBrowse files
|`docs/design/`, `docs/platforms/`, `docs/investigations/`, `docs/roadmap/`| Current design records (one per topic), platform notes, investigation conclusions, the work left to do |
164
+
|`docs/archive/`| Superseded designs and investigation narratives, kept for history (see its `README.md`) |
Copy file name to clipboardExpand all lines: benchmarks/rn-benchmark/COMPARISON.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# React Native's boundary against PythonMultiplatform's, measured the same way
2
2
3
3
Reference project: `/Volumes/macMini/thisisthepy/PythonMultiplatform`, whose figures below are
4
-
quoted from `docs/upcall-design.md`, `docs/downcall-design.md` and `ROADMAP.md` at the commit
4
+
quoted from `docs/design/upcall.md`, `docs/downcall-design.md` and `ROADMAP.md` at the commit
5
5
**`73c40da4`** (`develop`, 2026-08-14). **Nothing in the reference project was modified or re-run**;
6
6
its numbers are read, not reproduced.
7
7
@@ -13,7 +13,7 @@ its numbers are read, not reproduced.
13
13
**One fourth source, added for the iOS comparison and cited separately everywhere it appears:**
14
14
`docs/cost-table.md`, whose `iosSimulatorArm64` row was captured at **`958c0082b294`** at load
15
15
[1.97, 2.29, 5.92], marked uncontaminated, from three runs. §4b and §1c use it rather than
16
-
`upcall-design.md` because it is the only reference-side source that publishes an iOS upcall, its
16
+
`docs/design/upcall.md` because it is the only reference-side source that publishes an iOS upcall, its
17
17
same-run pure-Python callee control and its `withPython` scope figure together — the three cells the
18
18
comparison needs from one execution. Its upcall figure (2253.20–2312.97 ns) and §4a's quoted
19
19
2266–2301 ns are close but **are not the same measurement**; neither is derived from the other.
@@ -62,7 +62,7 @@ by reading generated code rather than documentation:
62
62
63
63
|| React Native | PythonMultiplatform |
64
64
|---|---|---|
65
-
|**iOS**| JSI (C++) → Objective-C message send. One crossing. The generated `RNBenchSpec.h` builds `NativeBenchSpecJSI` over `ObjCTurboModule::InitParams` and calls the ObjC method directly. | No runtime boundary at all: a `PyMethodDef` whose `ml_meth` is a `staticCFunction` in the same binary (`docs/upcall-design.md`, "cheapest of the three"). |
65
+
|**iOS**| JSI (C++) → Objective-C message send. One crossing. The generated `RNBenchSpec.h` builds `NativeBenchSpecJSI` over `ObjCTurboModule::InitParams` and calls the ObjC method directly. | No runtime boundary at all: a `PyMethodDef` whose `ml_meth` is a `staticCFunction` in the same binary (`docs/design/upcall.md` §7.4). |
66
66
|**Android**| JSI (C++) → **JNI** → Kotlin. Two crossings. Confirmed with `nm` on the built `libappmodules.so`: `NativeBenchSpecJSI::NativeBenchSpecJSI(JavaTurboModule::InitParams const&)`. | C entry point in `artMain/cinterop/jni_onload.def` → **JNI** → Kotlin. Two crossings, "one shim per shape, plus a JNI upcall per call". |
67
67
68
68
So on both projects Android is structurally the expensive side of the same asymmetry, for the same
@@ -107,7 +107,7 @@ all. Getting this wrong is the failure mode that matters most: two tables side b
107
107
comparison whether or not the cells correspond.
108
108
109
109
Reference-side sources: `UpcallBoundaryCostTest` (`commonTest`, quoted through
110
-
`docs/upcall-design.md` §"One upcall, across all five platforms") and `overhead/BenchmarkTest`
110
+
`docs/design/upcall.md` §"One upcall, across all five platforms") and `overhead/BenchmarkTest`
111
111
(quoted through `docs/downcall-design.md`).
112
112
113
113
| row here | what it charges | reference-project counterpart | same direction? | comparable? |
@@ -265,7 +265,7 @@ JS (Hermes, no JIT) --JSI--> C++ --JNI--> Kotlin, running on ART
265
265
266
266
The callee of every boundary row is `BenchModule.kt` executing on ART. **ART is precisely the
267
267
runtime whose tier-up the reference project measured, and it produced the largest warmup requirement
268
-
in its entire table** (`docs/upcall-design.md`, "Is 100 000 enough on a device?"):
268
+
in its entire table** (`docs/design/upcall.md` §7.2):
269
269
270
270
| reference target | first repetition ÷ plateau | flat from | margin at a 100 000 warmup |
271
271
|---|---|---|---|
@@ -350,7 +350,7 @@ row on iOS**, which is the opposite of what §3a predicts for Android.
350
350
351
351
### 4a. Ours, quoted (not re-run)
352
352
353
-
`UpcallBoundaryCostTest`, `docs/upcall-design.md`. **Re-quoted 2026-08-14 at `73c40da4`.** The
353
+
`UpcallBoundaryCostTest`, `docs/design/upcall.md`. **Re-quoted 2026-08-14 at `73c40da4`.** The
354
354
previous version of this table was taken at `bd0029d1` and is superseded: it carried four rows as
355
355
*italic* 3 000-warmup readings and two ART rows with three columns reading *not recorded*. Upstream
356
356
has since re-measured every device row at the 100 000 warmup and filled all five columns from one
Copy file name to clipboardExpand all lines: docs/INTENT.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ Behind the per-platform entry point, every platform uses the same generated func
78
78
no per-platform Python → Kotlin binding code to maintain.
79
79
80
80
> Inferred — confirm with the maintainer: this "one mechanism everywhere" property is a goal, not
81
-
> only an implementation detail. It is stated as a decision in `PROJECT.md` and `docs/design/upcall-design.md`.
81
+
> only an implementation detail. It is stated as a decision in `PROJECT.md` and `docs/design/upcall.md`.
82
82
83
83
## 3. What it deliberately is NOT
84
84
@@ -87,7 +87,7 @@ no per-platform Python → Kotlin binding code to maintain.
87
87
| A binder that renames namespaces (`androidx` → `pythonx`, or any other) | §2.2 |
88
88
| A replacement for the `pythonx` packages | §2.3 — they are real packages in their own repository |
89
89
| Runtime-reflection or name-lookup based binding | §2.1 — impossible under Kotlin/Native and native image |
90
-
| A hand-written wrapper per Kotlin function or class | Generic adaptation plus generated tables; per-declaration wrappers were tried in 2024 and rotted (`docs/design/pythonx-adapter-design.md`) |
90
+
| A hand-written wrapper per Kotlin function or class | Generic adaptation plus generated tables; per-declaration wrappers were tried in 2024 and rotted (`docs/archive/pythonx-adapter-design.md`) |
91
91
| A Python re-implementation, transpiler, or JVM-hosted Python | It embeds CPython itself, so C extensions keep working |
92
92
| A build tool, dependency resolver or packager | That is pypackpack (the work) and toolchain (the Gradle vocabulary) |
93
93
| A sub-interpreter parallelism model | Rejected: extensions that do not declare multi-interpreter support fail to import; parallelism comes from free-threaded CPython |
0 commit comments