Skip to content

Commit e68a0cc

Browse files
committed
make the build faster
1 parent 0bcaafd commit e68a0cc

26 files changed

Lines changed: 754 additions & 448 deletions

File tree

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,16 @@ shows the available edits.
9797

9898
The included benchmark suite runs both tools against the same Fortran kernels
9999
through their normal generated interfaces. Results are machine-dependent; the
100-
chart below is the latest committed snapshot.
100+
charts below are the latest committed snapshot.
101+
102+
**Runtime-call performance** — values above `1.0×` mean x2py is faster.
101103

102104
[![Relative performance of x2py and f2py across call, vector, and matrix workloads. Values above 1.0 mean x2py is faster.](docs/user/assets/performance-comparison.svg)](https://pynumlab.github.io/x2py/user/performance/)
103105

106+
**Clean end-to-end build time** — lower times are better.
107+
108+
[![Clean end-to-end build time for x2py and f2py under development and optimized compiler profiles. Lower times are better.](docs/user/assets/build-time-comparison.svg)](https://pynumlab.github.io/x2py/user/performance/#clean-build-time)
109+
104110
[See the complete results, test environment, and one-command reproduction instructions.](https://pynumlab.github.io/x2py/user/performance/)
105111

106112
## Installation & Quick Start

docs/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,16 @@ kernels through their normal generated interfaces. Results are
113113
machine-dependent; the detailed page records the complete environment and
114114
reproduction method.
115115

116+
**Runtime-call performance** — values above `1.0×` mean x2py is faster.
117+
116118
[![Relative performance of x2py and f2py across call, vector, and matrix workloads. Values above 1.0 mean x2py is faster.](user/assets/performance-comparison.svg)](user/performance.md)
117119
{ .x2py-performance-chart }
118120

121+
**Clean end-to-end build time** — lower times are better.
122+
123+
[![Clean end-to-end build time for x2py and f2py under development and optimized compiler profiles. Lower times are better.](user/assets/build-time-comparison.svg)](user/performance.md#clean-build-time)
124+
{ .x2py-performance-chart }
125+
119126
[View the full results and methodology →](user/performance.md)
120127

121128
---

docs/maintainer/design/wrapper-design-notes.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,27 @@ extension includes `binding_support/x2py_binding.h`. This header is an
8383
implementation detail of the generated extension, but its name is intentionally
8484
x2py-specific so it does not look like user source or a generic C wrapper.
8585
86-
The support header is header-only: each helper has internal linkage and is
87-
eligible for inlining when the generated binding translation unit is compiled.
88-
There is no separately compiled or linked support object. It exposes a
89-
deliberately small `x2py_*` mechanical API: scalar type matching, scalar
90-
unpacking, scalar creation as a Python or NumPy object, and release of a
91-
bridge-owned allocation. The generated binding passes the completed NumPy type,
92-
layout, ownership, and mutation decisions into those operations. Native support
93-
must not infer a layout, accept a different dtype, or choose ownership behavior
94-
from a value at runtime; those are completed wrapper-plan decisions.
86+
The support header is header-only and there is no separately compiled or linked
87+
support object. Small scalar helpers have internal linkage and are eligible for
88+
inlining when the generated binding translation unit is compiled. They are
89+
specialized by the completed scalar dtype instead of accepting a runtime dtype
90+
selector. Exact scalar inputs use one fused validation-and-unpack operation;
91+
the distinct coercive unpack operation is reserved for a completed boundary
92+
that permits Python scalar conversion, such as a callback result.
93+
94+
The normal-array native-handle fallback is also emitted once through this
95+
header, but remains out of line within each generated translation unit. Each
96+
array call site supplies the completed dtype, rank, shape, layout, mutability,
97+
and ABI-field selectors and receives one mechanical data/extent/stride result.
98+
This keeps the direct NumPy-array path local and small while avoiding a copy of
99+
the Python runtime import, call, reference cleanup, and tuple-unpack machinery
100+
for every array argument.
101+
102+
Together these helpers expose a deliberately small `x2py_*` mechanical API:
103+
typed scalar unpacking, scalar creation as a Python or NumPy object, native
104+
array-actual extraction, and release of a bridge-owned allocation. Native
105+
support must not infer a layout, accept a different dtype, or choose ownership
106+
behavior from a value at runtime; those are completed wrapper-plan decisions.
95107
X2PY_C_DOCS_END -->
96108

97109
<!-- X2PY_C_DOCS_START

docs/user/assets/build-time-comparison.svg

Lines changed: 14 additions & 14 deletions
Loading
Lines changed: 52 additions & 50 deletions
Loading

0 commit comments

Comments
 (0)