Skip to content

Reduce parser precompile workload#204

Merged
quinnj merged 1 commit into
mainfrom
codex/reduce-parsers-precompile-workload
Jun 4, 2026
Merged

Reduce parser precompile workload#204
quinnj merged 1 commit into
mainfrom
codex/reduce-parsers-precompile-workload

Conversation

@quinnj

@quinnj quinnj commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Narrow the PrecompileTools workload to core string, integer, Float64, and Bool parse/xparse cases.
  • Stop precompiling BigFloat, Dates, SubString, and view inputs in the default workload.
  • Add inference barriers around rare float widening branches so simple Float64 precompile avoids eagerly inferring the UInt128/BigInt overflow tree.

Measurements

Measured on Julia 1.12.5 in fresh temp projects/depots with dependency caches available:

  • Original workload: ~4.96s Parsers precompile, 5.5 MB dylib, 1142 Julia symbols.
  • This patch: ~2.54s Parsers precompile, 2.6 MB dylib, 388 Julia symbols.

First-call latency after precompile:

  • parse(Int64, "123"): ~16.8 ms
  • parse(Float64, "123.45"): ~18.3 ms
  • parse(Bool, "true"): ~16.4 ms
  • xparse(Float64, codeunits("123.45"), ...): ~2.0 ms
  • xparse(Float64, Vector(...), ..., Any): ~2.0 ms

Tests

  • julia --startup-file=no --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.test(; coverage=false)'
  • julia +1.6 --startup-file=no --project=. -e 'using Pkg; Pkg.instantiate(); using Parsers; @Assert Parsers.parse(Float64, "123.45") == 123.45; @Assert Parsers.xparse(Float64, Vector(codeunits("123.45")), 1, 6, Parsers.Options()).val == 123.45; println("julia ", VERSION, " focused checks ok")'
  • git diff --check

Co-authored by Codex

Trim the PrecompileTools workload to core scalar parse/xparse cases and avoid precompiling BigFloat, Dates, SubString, and view inputs.

Add inference barriers around rare float widening paths so simple Float64 precompile does not eagerly infer the UInt128/BigInt overflow tree.
@quinnj quinnj marked this pull request as ready for review June 2, 2026 21:45
@quinnj quinnj merged commit 0e3226e into main Jun 4, 2026
12 checks passed
@quinnj quinnj deleted the codex/reduce-parsers-precompile-workload branch June 4, 2026 16:13
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