• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

open-hyped / crane / 33797706263
97%

Build:
DEFAULT BRANCH: main
Ran 03 Sep 2026 07:40PM UTC
Jobs 1
Files 21
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Sep 2026 07:39PM UTC coverage: 95.718% (-0.7%) from 96.391%
33797706263

push

github

web-flow
perf: consumer shutdown and context reuse (#13)

* perf: stop re-serialising worker transforms and let consumers exit on a sentinel

Multiprocessing was slower than a single process, and got worse with every worker
added: measured on a tokenise-and-pack workload, 454 docs/s with num_proc=1 against
220 docs/s with 32 workers, while the same work under plain multiprocessing reached
5547 docs/s. Two causes, and neither fix helps much without the other.

Consumers never learned that the data had run out. QueueExamplesIterable leaves a
drained queue on its sentinel or, failing that, when its get times out after 30s -
and nothing anywhere posted the sentinel, so waiting out the timeout in full was the
only way a consumer could finish. That is the ordinary end of every run: once the
shard pool empties every remaining worker is made a consumer. On a 4-worker run whose
8 shards were done at t=18s, the run did not end until t=76s. The controller now
posts the sentinel once nothing can produce again - no pending shard, no producer,
and no standalone left to promote into one.

Worker contexts re-serialised the transform on every shard assignment. It closes over
the workload, which for a tokenising pipeline is the tokenizer: 5.7MB and 0.8s to
pickle, paid once per shard on the controller's single-threaded message loop, so
workers asking for their next shard waited behind it - measured idle 52% of the time.
apply_ctx already keeps the previous value for a field arriving as None, so an
unchanged transform is now simply omitted. Compared by identity, since a producer
context carries a different transform, and only recorded as delivered once the send
succeeds, so a dropped context does not leave a worker with no pipeline.

Ending the message loop on 'no worker alive' turned out to be unsafe once runs got
short: a worker is only marked alive when it reports READY, so a run that finished
before a straggler started would exit leaving it unjoined, tripping
assert_all_work... (continued)

210 of 226 new or added lines in 2 files covered. (92.92%)

9 existing lines in 1 file now uncovered.

1453 of 1518 relevant lines covered (95.72%)

0.96 hits per line

Uncovered Changes

Lines Coverage ∆ File
15
91.34
-1.04% src/crane/core/runners/multi_process_runner.py
1
94.55
-0.24% src/crane/core/iterables.py

Coverage Regressions

Lines Coverage ∆ File
9
91.34
-1.04% src/crane/core/runners/multi_process_runner.py
Jobs
ID Job ID Ran Files Coverage
1 33797706263.1 03 Sep 2026 07:40PM UTC 21
95.72
GitHub Action Run
Source Files on build 33797706263
  • Tree
  • List 21
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • e0f61d95 on github
  • Prev Build on main (#33752172766)
  • Next Build on main (#33800077147)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc