Skip to content

Consolidate benchmarks to one (the website tables); remove the rest#53

Merged
MDA2AV merged 6 commits into
mainfrom
feat/consolidate-benchmarks
Jun 17, 2026
Merged

Consolidate benchmarks to one (the website tables); remove the rest#53
MDA2AV merged 6 commits into
mainfrom
feat/consolidate-benchmarks

Conversation

@MDA2AV

@MDA2AV MDA2AV commented Jun 17, 2026

Copy link
Copy Markdown
Member

The repo had four overlapping benchmark setups plus a Kotlin bench mode — and confusingly, none of them produced the tables the docs site currently shows (those came from ad-hoc runs). This consolidates to one.

Kept: one self-contained benchmark

Benchmarks/ is now a single console app that reproduces exactly what the site shows — the three packages (Glyph11, Glyph11.Native, Glyph11.Pico) on:

  • contiguous request parsing,
  • multi-segment request parsing,
  • chunked body decoding,

best-of-5, payloads built in-process (identical bytes to the site). README.md explains how to run it (the native packages need their libs on the load path; Glyph11 needs nothing). Verified the numbers match the site within run-to-run noise.

Removed

  • bench/ — the cross-language scripts (run-all.sh, gen_payloads.py, aggregate.py, results)
  • core/bench/ + the GLYPH11_BUILD_BENCH CMake option
  • bindings/dotnet/Glyph11.Bench/
  • the Kotlin bench mode (Main.kt dispatch/function, Glyph11.kt benchParse/benchChunked/chunkDecodeHandle)
  • benchmark.yml — the BenchmarkDotNet PR regression-alert CI — and its BDN artifacts
  • the old FlexibleParser/UltraHardened BDN benchmarks

(Per your choice: simple best-of-5, no CI.)

Verified

  • The new benchmark reproduces the site tables.
  • dotnet build succeeds; packing the solution still produces only Glyph11 (the benchmark is IsPackable=false; the bindings stay out of the solution).
  • The Kotlin binding still compiles.

Branches on top of #52, so until that merges this diff also shows #52's commits.

MDA2AV added 6 commits June 17, 2026 11:29
Delete the old src/Examples (GenHTTP/ServerTest demos) and remove them from
src/Glyph11.sln. Add a root Examples/ with a runnable, fully-commented console
app per package, each covering every option:

- Glyph11.Example         — contiguous + multi-segment parse, custom limits,
  reading fields/headers/query, chunked decode, error handling, reuse/dispose
- Glyph11.Native.Example  — span + ReadOnlySequence (scratch + out parsed) parse,
  pooled storage, status codes / HTTP mapping, chunked decode, ABI
- Glyph11.Pico.Example    — memory + sequence parse, chunked via ChunkedBodyStream,
  the validation trade-off

Verified all three compile and run (managed needs no native; native/pico run
against a locally-built core via GLYPH11_NATIVE_PATH / GLYPH11_PICO_NATIVE_PATH).
Examples/README.md explains running each.
release.yml only packed src/ (Glyph11). Make it publish all three at their csproj
versions: keep the managed pack as a job, and call package-native.yml /
package-pico.yml as reusable workflows (with publish: true, secrets: inherit) so
one dispatch runs the native build matrices and pushes Native + Pico too.

- package-native/pico: add a workflow_call trigger; publish job now also fires when
  called; version uses the csproj <Version> on a real publish (tag still wins;
  PRs stay throwaway CI prereleases). --skip-duplicate keeps re-runs safe.
Put the examples in the solution for IDE convenience. Mark them IsPackable=false
/ IsPublishable=false so the Release pack (which packs the src solution) never
turns them into NuGets, and keep the Glyph11.Native/Glyph11.Pico projects OUT of
the solution (dotnet sln add pulls them in as references) — otherwise the managed
Release job would pack them without their native binaries. Verified: packing the
solution produces only Glyph11.0.3.5.nupkg; the examples still build via their
ProjectReferences.
…port)

GenHTTP wasn't only a demo — Benchmarks and Tests ProjectReference it and use
its types (Request, RequestMethod) to exercise FlexibleParser. Deleting
src/Examples broke their references. The Glyph11 package itself never uses
GenHTTP, so move it to tests/GenHTTP (test/bench support) and re-point:
- GenHTTP -> ..\..\src\Glyph11
- Benchmarks -> ..\tests\GenHTTP ; Tests -> ..\GenHTTP
- add tests/GenHTTP to src/Glyph11.sln (it's IsPackable=false, so Release still
  packs only Glyph11)

Build succeeds; all 366 tests pass.
GenHTTP's Request was only a wrapper whose .Source is a BinaryRequest, so the
FlexibleParser benchmarks and tests now target BinaryRequest directly (Reset ->
Clear, .Source dropped) — same coverage, no GenHTTP. Deleted tests/GenHTTP,
removed it from the solution and both ProjectReferences, and swapped the
incidental 'GenHTTP' server-name string in test payloads for 'Glyph11' (same
length, offsets unchanged).

Build succeeds; all 366 tests pass; no GenHTTP references remain.
There were four overlapping benchmark setups (/bench cross-language scripts,
/Benchmarks BDN, core/bench C, Glyph11.Bench FFI) plus a Kotlin bench mode, and
none produced the site's current tables. Replace them with a single
self-contained Benchmarks/ console app that reproduces exactly what the docs site
shows: the three packages (Glyph11, Glyph11.Native, Glyph11.Pico) on contiguous +
multi-segment request parsing and chunked decoding, best-of-5, payloads built
in-process.

Removed:
- bench/ (run-all.sh, gen_payloads.py, aggregate.py, results)
- core/bench/ + the GLYPH11_BUILD_BENCH CMake option
- bindings/dotnet/Glyph11.Bench/
- the Kotlin bench (Main.kt dispatch/fn, Glyph11.kt benchParse/benchChunked/chunkDecodeHandle)
- benchmark.yml (the BenchmarkDotNet PR regression-alert CI) and its BDN artifacts
- the FlexibleParser/UltraHardened BDN benchmarks

Verified: the new benchmark reproduces the site numbers; the solution builds and
packs only Glyph11; the Kotlin binding still compiles.
@MDA2AV MDA2AV merged commit 32f1879 into main Jun 17, 2026
24 checks passed
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