Skip to content

Releases

0.3.1

Choose a tag to compare

@mackoj mackoj released this 14 Nov 02:10
27212a1

Performance release: same output, byte for byte, much faster on large values. No API change.

  • ShellEscaping.quote was quadratic: it appended scalar by scalar through unicodeScalars, copying the string each time. It now quotes UTF-8 bytes into one allocation. Rendering a 1 MB JSON body: 172 ms → 1.5 ms.
  • Substitutions match on UTF-8 bytes (equivalent to scalars) and are prepared once per render; a piped binary body is only decoded when there are substitutions to look for.
  • Binary bodies are recognised from their control bytes before any decoding: converting a 1 MB binary body, 70 ms → 1.1 ms.
  • Header names are lowercased once per header, and bridged header strings copied to native UTF-8 once: 50 headers, 192 µs → 114 µs per conversion.
p50, release, Apple M5 Pro 0.3.0 0.3.1
Render, 1 MB JSON body 172 ms 1.5 ms
Convert and render, 1 MB binary body 70 ms 1.1 ms
Quote, 64 KB adversarial 7.7 ms 0.1 ms
Quote with substitutions, 128 KB 18.7 ms 0.37 ms
Convert and render, 50 headers (per conversion) 192 µs 114 µs
Convert and render, simple GET 5.1 µs 3.2 µs

Also new in the repository: benchmarks (Benchmarks/, see docs/performance.md) and architecture rules that guard the quoting invariants (docs/architecture-rules.md).

0.3.0

Choose a tag to compare

@mackoj mackoj released this 31 Oct 21:45
b85a40b
Merge pull request #3 from mackoj/feature/encoded-substitutions

Encoded shell substitutions: base64 and percent-encoding computed from the variable

0.2.0

Choose a tag to compare

@mackoj mackoj released this 31 Oct 17:01
622c4a0
Merge pull request #2 from mackoj/feature/shell-substitutions

Add ShellSubstitution: write literals as shell variables when rendering