Skip to content

chore: benchmark against html-to-text, inscriptis and rust html2text - #84

Merged
hownowstephen merged 1 commit into
mainfrom
chore_cross_language_benchmarks
Sep 23, 2026
Merged

hownowstephen merged 1 commit into
mainfrom
chore_cross_language_benchmarks

Conversation

@hownowstephen

Copy link
Copy Markdown
Contributor

Adds three widely used non-Go converters to the comparison benchmarks, so textplain's speed and output can be read against more than the two Go libraries.

  • workers_test.go runs each library as a long-lived worker fed length-prefixed frames over stdin, so timings exclude interpreter startup. Workers join implementations in TestMain, so BenchmarkConvert and TestFidelity pick them up unchanged.
  • testdata/{node,python,rust} holds the workers with pinned versions: html-to-text 10.0.1, inscriptis 2.7.4, html2text 0.17.1.
  • Wrapping libraries wrap at 65, like textplain.

Reviewer notes:

  • A worker that isn't set up is skipped with a message, so the benchmarks still run without Node, Python or Rust. Setup commands are in benchmarks/README.md.
  • Timings include a pipe round trip of about 10–30µs per document, measured with an echo worker. The new libraries take 180µs–1ms per document on the corpus emails, so the round trip is a small share.
  • The benchmarks module isn't run by CI, so nothing changes there.

@hownowstephen
hownowstephen merged commit 2b3cef4 into main Sep 23, 2026
2 checks passed
@hownowstephen
hownowstephen deleted the chore_cross_language_benchmarks branch September 23, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant