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
Copy file name to clipboardExpand all lines: source/network-endeavor/d4125-field-experience.md
+60-14Lines changed: 60 additions & 14 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
---
2
2
title: "Report: Coroutine-Native I/O at a Derivatives Exchange"
3
3
document: P4125R1
4
-
date: 2026-03-17
4
+
date: 2026-04-06
5
5
reply-to:
6
6
- "Mungo Gill <mungo.gill@me.com>"
7
7
- "C++ Alliance Proposal Team"
@@ -12,12 +12,17 @@ audience: SG14, LEWG
12
12
13
13
A derivatives exchange is porting from Asio callbacks to coroutine-native I/O. Early results: it works.
14
14
15
-
The paper reports qualitative findings from two structured interviews with the engineering team. The results are preliminary - the integration covers a subset of the platform and no performance benchmarks have been completed - but the field evidence is reported here for the committee's consideration.
15
+
The paper reports qualitative findings from three structured interviews with the engineering team. The results are preliminary - the integration covers a subset of the platform and no performance benchmarks have been completed - but the field evidence is reported here for the committee's consideration.
16
16
17
17
---
18
18
19
19
## Revision History
20
20
21
+
### R1: April 2026
22
+
23
+
- Added third engineer interview (Engineer C)
24
+
- Expanded build experience, timer migration, and documentation findings
@@ -64,16 +69,17 @@ The project is structured in phases: foundational library porting first, then TC
64
69
65
70
## 3. Methodology
66
71
67
-
Two structured interviews were conducted with members of the integration partner's engineering team in March 2026:
72
+
Three structured interviews were conducted with members of the integration partner's engineering team in March 2026:
68
73
69
74
-**Engineer A** (CEO, highly experienced C++ engineer): ~90 minute interview covering build integration, incremental adoption strategy, and architectural assessment.
70
75
-**Engineer B** (platform architect): ~70 minute interview covering callback-to-coroutine migration, error handling, and production readiness assessment.
76
+
-**Engineer C** (developer, newer to the codebase): ~55 minute interview covering build experience, documentation quality, timer migration, and coroutine design assessment. Engineer C had no prior production experience with C++ coroutines.
71
77
72
-
Both engineers had been working with Capy and Corosio for approximately two weeks at the time of their interviews. All quotes in this paper are verbatim transcriptions. A project journal maintained by the engineering team provided supplementary context.
78
+
Engineers A and B had been working with Capy and Corosio for approximately two weeks at the time of their interviews. Engineer C was interviewed one week later. All quotes in this paper are verbatim transcriptions. A project journal maintained by the engineering team provided supplementary context.
73
79
74
-
The interviews were qualitative. No metrics, benchmarks, or automated measurements are reported. The findings represent the subjective assessments of two experienced engineers at the early stage of an ongoing integration. They carry the weight appropriate to their scope.
80
+
The interviews were qualitative. No metrics, benchmarks, or automated measurements are reported. The findings represent the subjective assessments of three engineers at the early stage of an ongoing integration. They carry the weight appropriate to their scope.
75
81
76
-
Both interviews were conducted remotely over video call; the Capy/Corosio author was present for technical questions but did not participate in the assessment discussions.
82
+
All interviews were conducted remotely over video call; the Capy/Corosio author was present for technical questions but did not participate in the assessment discussions.
77
83
78
84
---
79
85
@@ -91,9 +97,21 @@ Migrating production callback-based code to coroutines was feasible and less dis
91
97
92
98
> "The changes we've had to make haven't been as drastic as maybe once thought." - Engineer B
93
99
100
+
Engineer C, working independently on a different part of the codebase, reached the same conclusion:
101
+
102
+
> "It was easier than expected I think." - Engineer C
103
+
94
104
Recursive callback patterns (retry loops, reconnection handlers) converted naturally to structured coroutine loops, which the engineers described as simpler and more readable than the callback originals.
95
105
96
-
### 4.2 Incremental Adoption
106
+
### 4.2 Timer Migration
107
+
108
+
Engineer C's work focused on replacing Asio timer callbacks with coroutine equivalents. The Asio pattern uses recursive callbacks - a timer fires, executes a handler, and re-arms itself within the same handler. This pattern does not translate directly to coroutines:
109
+
110
+
> "We relied on an Asio callback which does a recursive thing - it's kind of like set up the timer and it expires on a given interval, keeps re-entering the same function. But with coroutines I don't think you can do that recursively." - Engineer C
111
+
112
+
Engineer C considered symmetric transfer as a solution but concluded it would result in a stack overflow. The correct coroutine equivalent is a simple loop with `co_await` on each timer expiry - a structurally simpler construct, but one that requires recognising the pattern translation.
113
+
114
+
### 4.3 Incremental Adoption
97
115
98
116
Engineer A designed a "springboard function" approach to insulate the existing callback codebase from requiring full coroutine propagation:
99
117
@@ -103,14 +121,30 @@ Engineer A designed a "springboard function" approach to insulate the existing c
103
121
104
122
The approach uses an `executor_traits` abstraction layer allowing parallel Asio and Capy implementations. Tests run identically against both backends, validating behavioural equivalence. The dual-backend approach allowed the team to port incrementally without disrupting the existing Asio codebase.
105
123
106
-
### 4.3 Coroutine-Only Design
124
+
### 4.4 Coroutine-Only Design
107
125
108
126
Engineer B endorsed the coroutine-only design philosophy:
109
127
110
128
> "The tradeoffs around callbacks versus coroutines - if you've got a sufficiently modern codebase, I think there's a very strong reason that you could choose the coroutine route and have very little tradeoff." - Engineer B
111
129
112
130
> "Doing one thing and doing it very well and focusing just on that, I think, has a lot of merit." - Engineer B
113
131
132
+
Engineer C found the coroutine model more intuitive to write but was more cautious about its fit with existing code:
133
+
134
+
> "It feels like there's a ground up approach with Capy and the use of the tasks which is really easy to use and it feels like it's quite easy to start constructing a larger application. But I'm still not sure how it fits into an existing application." - Engineer C
135
+
136
+
### 4.5 Build Experience
137
+
138
+
Engineer C reported a straightforward build experience. The CMake snippet in the repository README compiled cleanly on the first attempt, and the dependency relationship between Capy and Corosio was handled automatically. Time from source code to a running programme was less than one hour. Compilation times were not noticeably different from Asio.
139
+
140
+
### 4.6 Documentation
141
+
142
+
Documentation was generally praised. Engineer C, who had no prior coroutine experience, found the introductory topics in Capy on coroutines and concurrency brought him up to speed effectively. He compared the documentation favourably to Asio's:
143
+
144
+
> "With the Capy documentation there's obviously a lot more of a background explained with your documents." - Engineer C
145
+
146
+
Areas identified for improvement included the stream concepts section (which assumed background knowledge the developer did not have) and code examples (which could benefit from wider context - full programmes rather than isolated snippets). These are documentation issues, not library design issues, but they affect adoption.
147
+
114
148
---
115
149
116
150
## 5. Error Handling
@@ -143,9 +177,19 @@ Engineer B's assessment is more confident:
143
177
144
178
> "I would definitely not steer anyone away from it after what I've experienced so far." - Engineer B
145
179
146
-
Engineer B's endorsement carries a caveat for teams with deeply entrenched Asio codebases - particularly those with complex multi-threading and multiple thread pools, where the migration would be substantially harder.
180
+
Engineer C's assessment was more measured - he is earlier in the integration process and working on a narrower scope:
181
+
182
+
> "I would say it's felt like a smooth process so far." - Engineer C
147
183
148
-
These assessments are based on approximately two weeks of integration work covering a subset of the platform. No performance benchmarks have been completed. These are early indicators, not final verdicts.
184
+
> "We'd have to be sure that production or similar deployment of all our existing components have the same behaviour. So that's still a while off." - Engineer C
185
+
186
+
When asked what he would warn another team considering the port:
187
+
188
+
> "I'd probably warn about the length of time that it would take. Wondering whether trading off the length of time would be worth it." - Engineer C
189
+
190
+
Engineers B and C both noted caveats for teams with deeply entrenched Asio codebases - particularly those with complex multi-threading and multiple thread pools, where the migration would be substantially harder. The time investment required for a complete port should not be underestimated.
191
+
192
+
These assessments are based on two to three weeks of integration work covering a subset of the platform. No performance benchmarks have been completed. These are early indicators, not final verdicts.
149
193
150
194
---
151
195
@@ -163,24 +207,26 @@ How errors flow through coroutine pipelines is not an abstract design question.
163
207
164
208
[P4003R0](https://wg21.link/p4003r0)<sup>[3]</sup> proposes that C++20 coroutines are suited to I/O, and [P4014R0](https://wg21.link/p4014r0)<sup>[5]</sup> argues that coroutines (direct style) are a natural complement to senders (continuation-passing style). The integration described in this paper provides early qualitative evidence bearing on these claims.
165
209
166
-
A derivatives exchange platform with a large, predominantly C++ codebase and a majority callback-based architecture is porting to a coroutine-native library. After two weeks of work, two engineers independently found the migration less disruptive than anticipated and endorsed the coroutine-only design philosophy. These are preliminary impressions from experienced engineers, not validated production results.
210
+
A derivatives exchange platform with a large, predominantly C++ codebase and a majority callback-based architecture is porting to a coroutine-native library. After two to three weeks of work, three engineers independently found the migration less disruptive than anticipated. Two endorsed the coroutine-only design philosophy; the third found it intuitive but reserved judgement on its fit with existing applications. These are preliminary impressions, not validated production results.
167
211
168
212
[P4007R1](https://isocpp.org/files/papers/P4007R1.pdf)<sup>[4]</sup> notes that zero open-source sender-based networking stacks exist, while six coroutine-based stacks are in production use. This integration adds a seventh data point.
169
213
170
214
### 7.3 Accessibility
171
215
172
-
[P4014R0](https://wg21.link/p4014r0)<sup>[5]</sup> argues that the sender model constitutes a "sub-language" with its own control flow, variable binding, and error handling - creating a learning burden distinct from standard C++. Both engineers in this study found a coroutine-native API at least as accessible as Asio's callback model. Engineer A observed:
216
+
[P4014R0](https://wg21.link/p4014r0)<sup>[5]</sup> argues that the sender model constitutes a "sub-language" with its own control flow, variable binding, and error handling - creating a learning burden distinct from standard C++. All three engineers in this study found a coroutine-native API at least as accessible as Asio's callback model. Engineer A observed:
173
217
174
218
> "This library is probably something a new user could turn to and use pretty much directly." - Engineer A
175
219
220
+
Engineer C had no prior production experience with C++ coroutines and found the documentation sufficient to become productive. His introductory exposure was limited to a single ACCU conference talk on C++20 several years earlier.
221
+
176
222
---
177
223
178
224
## 8. Limitations of This Study
179
225
180
226
This paper reports early-stage, qualitative findings. The following limitations apply:
181
227
182
-
-**Small sample.**Two engineers from one organisation. Their experience may not generalise.
183
-
-**Early stage.** Approximately two weeks of integration work. The porting covers a subset of the platform. No production traffic has been routed through the coroutine-native code.
228
+
-**Small sample.**Three engineers from one organisation. Their experience may not generalise.
229
+
-**Early stage.** Approximately two to three weeks of integration work. The porting covers a subset of the platform. No production traffic has been routed through the coroutine-native code.
184
230
-**No benchmarks.** The central research question - whether coroutine-native I/O can match or exceed Asio's performance - remains unanswered. The benchmarking phase has not begun.
185
231
-**Qualitative, not quantitative.** All findings are based on interview responses. No automated measurements, code metrics, or defect counts are reported.
186
232
-**Author affiliation.** The libraries under test were developed by the author's organisation. The integration partner is independent, but the study design and reporting are not.
0 commit comments