Skip to content

Commit 559b9cc

Browse files
committed
Added 3rd (pre-Croydon) interview to 4125
1 parent 486e189 commit 559b9cc

File tree

1 file changed

+60
-14
lines changed

1 file changed

+60
-14
lines changed

source/network-endeavor/d4125-field-experience.md

Lines changed: 60 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Report: Coroutine-Native I/O at a Derivatives Exchange"
33
document: P4125R1
4-
date: 2026-03-17
4+
date: 2026-04-06
55
reply-to:
66
- "Mungo Gill <mungo.gill@me.com>"
77
- "C++ Alliance Proposal Team"
@@ -12,12 +12,17 @@ audience: SG14, LEWG
1212

1313
A derivatives exchange is porting from Asio callbacks to coroutine-native I/O. Early results: it works.
1414

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.
1616

1717
---
1818

1919
## Revision History
2020

21+
### R1: April 2026
22+
23+
- Added third engineer interview (Engineer C)
24+
- Expanded build experience, timer migration, and documentation findings
25+
2126
### R0: March 2026
2227

2328
- Initial version. Early-stage qualitative findings only.
@@ -64,16 +69,17 @@ The project is structured in phases: foundational library porting first, then TC
6469

6570
## 3. Methodology
6671

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:
6873

6974
- **Engineer A** (CEO, highly experienced C++ engineer): ~90 minute interview covering build integration, incremental adoption strategy, and architectural assessment.
7075
- **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.
7177

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.
7379

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.
7581

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.
7783

7884
---
7985

@@ -91,9 +97,21 @@ Migrating production callback-based code to coroutines was feasible and less dis
9197
9298
> "The changes we've had to make haven't been as drastic as maybe once thought." - Engineer B
9399
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+
94104
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.
95105

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
97115

98116
Engineer A designed a "springboard function" approach to insulate the existing callback codebase from requiring full coroutine propagation:
99117

@@ -103,14 +121,30 @@ Engineer A designed a "springboard function" approach to insulate the existing c
103121
104122
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.
105123

106-
### 4.3 Coroutine-Only Design
124+
### 4.4 Coroutine-Only Design
107125

108126
Engineer B endorsed the coroutine-only design philosophy:
109127

110128
> "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
111129
112130
> "Doing one thing and doing it very well and focusing just on that, I think, has a lot of merit." - Engineer B
113131
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+
114148
---
115149

116150
## 5. Error Handling
@@ -143,9 +177,19 @@ Engineer B's assessment is more confident:
143177
144178
> "I would definitely not steer anyone away from it after what I've experienced so far." - Engineer B
145179
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
147183
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.
149193

150194
---
151195

@@ -163,24 +207,26 @@ How errors flow through coroutine pipelines is not an abstract design question.
163207

164208
[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.
165209

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.
167211

168212
[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.
169213

170214
### 7.3 Accessibility
171215

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:
173217

174218
> "This library is probably something a new user could turn to and use pretty much directly." - Engineer A
175219
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+
176222
---
177223

178224
## 8. Limitations of This Study
179225

180226
This paper reports early-stage, qualitative findings. The following limitations apply:
181227

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.
184230
- **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.
185231
- **Qualitative, not quantitative.** All findings are based on interview responses. No automated measurements, code metrics, or defect counts are reported.
186232
- **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

Comments
 (0)