Skip to content

Add RawMessage marshal support to unstable - #1084

Merged
pelletier merged 2 commits into
v2from
raw-message-marshal
Jul 3, 2026
Merged

pelletier merged 2 commits into
v2from
raw-message-marshal

Conversation

@pelletier

@pelletier pelletier commented Jun 24, 2026 •

Copy link
Copy Markdown
Owner

What

Makes unstable.RawMessage round-trip like json.RawMessage by adding the encode half of the feature.

The decode side already existed: unstable.RawMessage captures raw TOML when Decoder.EnableUnmarshalerInterface() is set (the unstable.Unmarshaler work from #873 → #940 → #1027, plus root documents in #1083). But marshaling a RawMessage emitted the underlying []byte as an array of integers (plugin = [110, 97, ...]), so it could not round-trip. This PR adds the missing encoder support.

Fixes #796.

API (all new public API stays in unstable)

  • unstable.Marshaler — MarshalTOML() ([]byte, error), the encode counterpart of unstable.Unmarshaler, implemented by RawMessage (value receiver, mirroring json.RawMessage). It can be called more than once for the same value during a single encode, so it must be deterministic.
  • Encoder.EnableMarshalerInterface() — opt-in toggle in the toml package, exactly mirroring the existing Decoder.EnableUnmarshalerInterface() (both carry the *Unstable:* disclaimer). It is the only addition to the stable package, is backward compatible, and the default toml.Marshal/Encode behavior is unchanged.

Behavior

With the interface enabled, the encoder splices a Marshaler's bytes verbatim, parsing them to pick the valid position:

RawMessage content emitted as
a single value (42, "x", [1,2], {a=1}) key = <raw>
key-value lines (name = "x"\n...) [key] table body
[]RawMessage of table bodies [[key]] array of tables
at the document root the whole document (counterpart of #1083's root decode)
empty / whitespace omitted
not valid TOML for its position error (like json.RawMessage with invalid JSON)
table content forced inline (e.g. SetTablesInline) error

Spliced bytes are validated by the same parser the decoder uses, so a Marshaler cannot silently corrupt the document; validation runs against the bytes actually emitted, so even a non-deterministic implementation cannot splice table content into a value position. A table-shaped body under a commented field is comment-prefixed line by line, like structurally encoded tables.

type Config struct {
    Plugin unstable.RawMessage `toml:"plugin"`
}

var cfg Config
toml.NewDecoder(r).EnableUnmarshalerInterface().Decode(&cfg)
// ... inspect / pass through cfg.Plugin ...
toml.NewEncoder(w).EnableMarshalerInterface().Encode(cfg) // [plugin] re-emitted verbatim

Documented limitation

Bodies are spliced verbatim (the json.RawMessage philosophy). A captured table body that itself contains sub-table headers keeps those headers relative to the captured root, so it round-trips exactly only when re-emitted at the same depth. Flat tables, scalars, inline tables, arrays-of-tables — and whole documents at the root, where headers are absolute — round-trip exactly. This is pinned by a test.

Performance

No regression on the default (interface-disabled) path:

  • the entry struct is unchanged at 64 bytes (the classification is packed into valueOptions' existing padding);
  • all marshaler logic lives in separate methods gated behind the opt-in flag, so the hot encoder functions keep their baseline size and allocation profile (the only addition outside gated code is one short-circuited flag test in encodeRoot, once per document).

Order-balanced benchstat of ./benchmark/ shows the per-op-sensitive Marshal/SimpleDocument cases unchanged (~); allocs/op are identical.

Tests

marshaler_raw_test.go adds coverage for every value shape, single/array tables, nested fields, map values, custom and pointer-receiver Marshalers, error propagation, empty omission, inline-context errors, invalid-content errors, commented table bodies, non-deterministic marshalers, root documents, the documented limitation, and full decode→encode→decode round-trips (fields, array tables, and whole documents at the root), plus BenchmarkMarshalRawMessage and a godoc example.

🤖 Generated with Claude Code

@pelletier
pelletier force-pushed the raw-message-marshal branch from f9858c2 to cfaeacc Compare June 24, 2026 23:54
@pelletier pelletier changed the title Add RawMessage marshal support to unstable (#796) Add RawMessage marshal support to unstable Jun 24, 2026
@pelletier
pelletier force-pushed the raw-message-marshal branch 2 times, most recently from 93c30ab to 4c63792 Compare June 25, 2026 00:52
pelletier and others added 2 commits July 2, 2026 22:33
unstable.RawMessage could already capture raw TOML on decode via
Decoder.EnableUnmarshalerInterface, but marshaling it emitted the
underlying []byte as an integer array, so it could not round-trip.
This adds the encode half so RawMessage behaves like json.RawMessage.

- unstable.Marshaler interface (MarshalTOML), the encode counterpart of
  Unmarshaler, implemented by RawMessage.
- Encoder.EnableMarshalerInterface(): an opt-in toggle mirroring
  Decoder.EnableUnmarshalerInterface (both carry the *Unstable* disclaimer).
  Default Marshal/Encode behavior is unchanged.
- The encoder classifies a Marshaler's bytes by parsing them: a single value
  is spliced inline (key = <raw>), key-value lines become a [key] table body,
  and a []RawMessage of table bodies becomes an array of tables. Empty output
  is omitted; table content forced inline is an error.

All new public API stays in unstable. The default encode path keeps its exact
layout: the entry struct is unchanged at 64 bytes (the classification is
packed into valueOptions padding) and all marshaler logic lives in separate
methods gated behind the opt-in flag, so existing marshal/unmarshal
benchmarks are unaffected.

Tests cover every value shape, single/array tables, custom and
pointer-receiver marshalers, error propagation, empty omission,
inline-context errors, the documented relative-sub-table-header limitation,
and full decode->encode->decode round-trips, plus a benchmark and a godoc
example.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Follow-ups to the unstable.Marshaler encoder support:

- Reject MarshalTOML output that is not valid TOML for its position
  instead of silently emitting an invalid document, mirroring
  json.RawMessage's validation of raw bytes.
- Comment-prefix spliced table bodies under commented tables and array
  tables. Previously only the header was commented, so the body leaked
  into the document as live keys of the parent table.
- Support a Marshaler at the document root, emitting its bytes as the
  whole document: the encode counterpart of the decoder delivering the
  whole document to a root Unmarshaler (#994). At the root the bytes
  are parsed as a document, so table headers keep their absolute
  position and whole-document round-trips are exact.
- Re-validate the bytes returned by the emit-time MarshalTOML call, so
  an implementation returning different content than during
  classification cannot splice table content into a value position.
- Document that MarshalTOML can be called more than once per encode and
  must be deterministic; include the type in its error messages.

The default (interface-disabled) encode path is unchanged: all new
work sits behind the existing marshalerOn checks, plus one
short-circuited flag test in encodeRoot that runs once per document.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pelletier
pelletier force-pushed the raw-message-marshal branch from a48d0f0 to 0ba5b18 Compare July 3, 2026 02:34
@pelletier pelletier added the feature Issue asking for a new feature in go-toml. label Jul 3, 2026
@pelletier
pelletier merged commit 57fec25 into v2 Jul 3, 2026
13 checks passed
@pelletier
pelletier deleted the raw-message-marshal branch July 3, 2026 03:10
pelletier added a commit that referenced this pull request Jul 3, 2026
Benchmarking the Marshaler-interface commit (#1084) against v2 on
linux/amd64 (interleaved rounds, n=12, benchstat) showed statistically
significant sec/op regressions on the default (interface-disabled)
Marshal path — up to +10% on micro-benchmarks — with allocations
unchanged. Bisecting the diff piece by piece isolated the dominant
cause: widening the per-type typeEncProps cache struct from 2 to 3
bytes. Its cached p.(typeEncProps) assertion and by-value return run
two to three times per encoded value, and the extra field changes the
copy size and register shape of every lookup; that lone change
reproduced the regression with zero encoder-code modifications.

- typeEncProps and encPropsForType are restored to their exact baseline
  form. The unstable.Marshaler classification lives in its own
  sync.Map (typeMarshalerCache/marshalerPropsForType), consulted only
  on EnableMarshalerInterface paths.
- encodeTable, encodeKeyValue and encodeArrayTable are restored to
  their exact baseline source. The Marshaler-aware variants of the
  table passes live in encodeTableWithMarshalers and
  encodeArrayTableWithMarshalers, selected by one branch per table
  instead of one per entry. Marshaler values on a `key =` line flow
  through appendValue's gated guard, which returns without rejoining
  the fall-through path and re-classifies the fetched bytes (keeping
  the emit-time guard), so appendMarshalerInlineValue is gone.
- All Marshaler-interface machinery moves to a new marshaler_raw.go so
  the feature's cold code does not sit between the default path's hot
  functions.

After this change the interface-off encoder differs from baseline only
by four single-branch dispatches; typeEncProps, encPropsForType and the
hot encoder functions are byte-identical to the pre-#1084 source.
allocs/op are identical across the whole ./benchmark suite. Remaining
µs-scale sec/op deltas are within this host's address-alignment noise
floor, demonstrated by dead-code A/A controls and -randlayout runs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pelletier

Copy link
Copy Markdown
Owner Author

Post-merge benchmarking of this feature against the pre-merge base (idle linux/amd64 host, pinned cores, interleaved rounds, n=12) found a default-path (interface-disabled) Marshal regression of up to +10% on µs-scale micro-benchmarks, with allocations unchanged — it was invisible to the alloc counts and the noisy-host ~ benchstat this PR's claim relied on.

Root cause and fix are in #1090 (dominant term: widening the per-type typeEncProps cache struct; that lone change reproduces +3.8% geomean with zero encoder-code modifications). Full methodology and attribution ledger are posted there.

Benchstat: v2 pre-#1084 (79f82e3) vs #1084 + #1090 (c0a09d4) — full ./benchmark suite, go1.26.4, linux/amd64
goos: linux
goarch: amd64
pkg: github.com/pelletier/go-toml/v2/benchmark
cpu: AMD Ryzen Threadripper PRO 3975WX 32-Cores     
                                  │ /tmp/pub2-old.txt │         /tmp/pub2-new.txt          │
                                  │      sec/op       │   sec/op     vs base               │
UnmarshalDataset/config-8                10.037m ± 2%   9.990m ± 2%       ~ (p=0.755 n=12)
UnmarshalDataset/canada-8                 26.48m ± 3%   25.53m ± 4%  -3.58% (p=0.024 n=12)
UnmarshalDataset/citm_catalog-8           14.59m ± 2%   14.55m ± 1%       ~ (p=0.843 n=12)
UnmarshalDataset/twitter-8                3.534m ± 2%   3.636m ± 4%       ~ (p=0.068 n=12)
UnmarshalDataset/code-8                   32.48m ± 1%   32.60m ± 3%       ~ (p=0.671 n=12)
UnmarshalDataset/example-8                67.40µ ± 3%   67.91µ ± 3%       ~ (p=0.291 n=12)
Unmarshal/SimpleDocument/struct-8         345.0n ± 3%   357.5n ± 3%  +3.62% (p=0.002 n=12)
Unmarshal/SimpleDocument/map-8            397.1n ± 2%   401.0n ± 4%       ~ (p=0.089 n=12)
Unmarshal/ReferenceFile/struct-8          37.37µ ± 2%   37.84µ ± 3%       ~ (p=0.319 n=12)
Unmarshal/ReferenceFile/map-8             30.20µ ± 2%   30.87µ ± 4%       ~ (p=0.561 n=12)
Unmarshal/HugoFrontMatter-8               5.346µ ± 2%   5.399µ ± 4%       ~ (p=0.745 n=12)
Marshal/SimpleDocument/struct-8           369.8n ± 3%   385.9n ± 3%  +4.37% (p=0.032 n=12)
Marshal/SimpleDocument/map-8              608.1n ± 4%   615.0n ± 2%       ~ (p=0.386 n=12)
Marshal/ReferenceFile/struct-8            20.90µ ± 3%   21.38µ ± 3%  +2.28% (p=0.028 n=12)
Marshal/ReferenceFile/map-8               39.74µ ± 6%   41.61µ ± 2%  +4.70% (p=0.010 n=12)
Marshal/HugoFrontMatter-8                 7.953µ ± 5%   8.416µ ± 2%  +5.82% (p=0.000 n=12)
RealWorldContainerdConfig-8               35.36µ ± 1%   36.10µ ± 3%       ~ (p=0.068 n=12)
RealWorldViperRead-8                      7.784µ ± 3%   7.764µ ± 5%       ~ (p=0.514 n=12)
RealWorldViperWrite-8                     13.07µ ± 4%   13.76µ ± 3%  +5.27% (p=0.010 n=12)
RealWorldHugoFrontMatterBatch-8           88.29µ ± 4%   87.60µ ± 4%       ~ (p=0.143 n=12)
RealWorldGitleaksRules-8                  55.18µ ± 2%   55.56µ ± 3%       ~ (p=0.160 n=12)
RealWorldPyproject-8                      14.11µ ± 2%   13.89µ ± 2%       ~ (p=0.198 n=12)
RealWorldGolangciStrict-8                 10.37µ ± 3%   10.39µ ± 2%       ~ (p=0.713 n=12)
geomean                                   44.78µ        45.41µ       +1.40%

                                  │ /tmp/pub2-old.txt │          /tmp/pub2-new.txt           │
                                  │        B/s        │      B/s       vs base               │
UnmarshalDataset/config-8                99.64Mi ± 3%   100.12Mi ± 2%       ~ (p=0.744 n=12)
UnmarshalDataset/canada-8                79.28Mi ± 3%    82.22Mi ± 4%  +3.71% (p=0.024 n=12)
UnmarshalDataset/citm_catalog-8          36.48Mi ± 2%    36.57Mi ± 1%       ~ (p=0.832 n=12)
UnmarshalDataset/twitter-8               119.2Mi ± 2%    115.9Mi ± 5%       ~ (p=0.068 n=12)
UnmarshalDataset/code-8                  78.81Mi ± 1%    78.52Mi ± 3%       ~ (p=0.671 n=12)
UnmarshalDataset/example-8               114.6Mi ± 3%    113.7Mi ± 3%       ~ (p=0.291 n=12)
Unmarshal/SimpleDocument/struct-8        30.41Mi ± 3%    29.34Mi ± 3%  -3.50% (p=0.002 n=12)
Unmarshal/SimpleDocument/map-8           26.42Mi ± 2%    26.16Mi ± 4%       ~ (p=0.089 n=12)
Unmarshal/ReferenceFile/struct-8         133.8Mi ± 2%    132.1Mi ± 3%       ~ (p=0.319 n=12)
Unmarshal/ReferenceFile/map-8            165.5Mi ± 2%    161.9Mi ± 4%       ~ (p=0.561 n=12)
Unmarshal/HugoFrontMatter-8              97.41Mi ± 2%    96.45Mi ± 5%       ~ (p=0.755 n=12)
Marshal/SimpleDocument/struct-8          30.94Mi ± 2%    29.66Mi ± 3%  -4.15% (p=0.032 n=12)
Marshal/SimpleDocument/map-8             18.82Mi ± 4%    18.61Mi ± 2%       ~ (p=0.386 n=12)
Marshal/ReferenceFile/struct-8           93.85Mi ± 3%    91.76Mi ± 3%  -2.23% (p=0.030 n=12)
Marshal/ReferenceFile/map-8              48.11Mi ± 5%    45.95Mi ± 2%  -4.49% (p=0.010 n=12)
Marshal/HugoFrontMatter-8                62.72Mi ± 4%    59.26Mi ± 2%  -5.51% (p=0.000 n=12)
RealWorldContainerdConfig-8              73.39Mi ± 1%    71.88Mi ± 3%       ~ (p=0.068 n=12)
RealWorldViperRead-8                     79.40Mi ± 3%    79.60Mi ± 5%       ~ (p=0.514 n=12)
RealWorldViperWrite-8                    47.22Mi ± 4%    44.86Mi ± 3%  -5.00% (p=0.010 n=12)
RealWorldHugoFrontMatterBatch-8          85.33Mi ± 4%    86.01Mi ± 4%       ~ (p=0.143 n=12)
RealWorldGitleaksRules-8                 59.50Mi ± 2%    59.09Mi ± 3%       ~ (p=0.160 n=12)
RealWorldPyproject-8                     78.01Mi ± 2%    79.24Mi ± 2%       ~ (p=0.198 n=12)
RealWorldGolangciStrict-8                64.36Mi ± 3%    64.23Mi ± 2%       ~ (p=0.713 n=12)
geomean                                  65.63Mi         64.73Mi       -1.38%

                                  │ /tmp/pub2-old.txt │           /tmp/pub2-new.txt           │
                                  │       B/op        │     B/op      vs base                 │
UnmarshalDataset/config-8               3.560Mi ±  0%   3.560Mi ± 0%       ~ (p=0.580 n=12)
UnmarshalDataset/canada-8               5.531Mi ± 15%   5.531Mi ± 1%       ~ (p=0.988 n=12)
UnmarshalDataset/citm_catalog-8         4.319Mi ±  5%   4.330Mi ± 5%       ~ (p=0.620 n=12)
UnmarshalDataset/twitter-8              1.255Mi ±  0%   1.255Mi ± 0%       ~ (p=0.178 n=12)
UnmarshalDataset/code-8                 6.183Mi ±  0%   6.183Mi ± 0%       ~ (p=0.075 n=12)
UnmarshalDataset/example-8              28.96Ki ±  0%   28.96Ki ± 0%       ~ (p=0.182 n=12)
Unmarshal/SimpleDocument/struct-8         21.00 ±  0%     21.00 ± 0%       ~ (p=1.000 n=12) ¹
Unmarshal/SimpleDocument/map-8            365.0 ±  0%     365.0 ± 0%       ~ (p=1.000 n=12) ¹
Unmarshal/ReferenceFile/struct-8        3.314Ki ±  0%   3.315Ki ± 0%       ~ (p=0.408 n=12)
Unmarshal/ReferenceFile/map-8           14.14Ki ±  0%   14.14Ki ± 0%       ~ (p=0.651 n=12)
Unmarshal/HugoFrontMatter-8             3.017Ki ±  0%   3.017Ki ± 0%       ~ (p=1.000 n=12)
Marshal/SimpleDocument/struct-8           176.0 ±  0%     176.0 ± 0%       ~ (p=1.000 n=12) ¹
Marshal/SimpleDocument/map-8              176.0 ±  0%     176.0 ± 0%       ~ (p=1.000 n=12) ¹
Marshal/ReferenceFile/struct-8          3.033Ki ±  0%   3.033Ki ± 0%       ~ (p=0.671 n=12)
Marshal/ReferenceFile/map-8             3.470Ki ±  0%   3.470Ki ± 0%       ~ (p=0.640 n=12)
Marshal/HugoFrontMatter-8                 944.0 ±  0%     944.0 ± 0%       ~ (p=1.000 n=12) ¹
RealWorldContainerdConfig-8             8.614Ki ±  0%   8.614Ki ± 0%       ~ (p=0.788 n=12)
RealWorldViperRead-8                    3.635Ki ±  0%   3.634Ki ± 0%  -0.03% (p=0.027 n=12)
RealWorldViperWrite-8                     560.0 ±  0%     560.0 ± 0%       ~ (p=1.000 n=12) ¹
RealWorldHugoFrontMatterBatch-8         37.84Ki ±  0%   37.84Ki ± 0%       ~ (p=0.128 n=12)
RealWorldGitleaksRules-8                11.48Ki ±  0%   11.48Ki ± 0%       ~ (p=1.000 n=12)
RealWorldPyproject-8                    7.762Ki ±  0%   7.762Ki ± 0%       ~ (p=0.304 n=12)
RealWorldGolangciStrict-8               2.463Ki ±  0%   2.463Ki ± 0%       ~ (p=0.494 n=12)
geomean                                 11.01Ki         11.01Ki       +0.01%
¹ all samples are equal

                                  │ /tmp/pub2-old.txt │          /tmp/pub2-new.txt           │
                                  │     allocs/op     │  allocs/op   vs base                 │
UnmarshalDataset/config-8                 70.19k ± 0%   70.19k ± 0%       ~ (p=1.000 n=12) ¹
UnmarshalDataset/canada-8                 223.2k ± 0%   223.2k ± 0%       ~ (p=0.590 n=12)
UnmarshalDataset/citm_catalog-8           49.98k ± 0%   49.98k ± 0%       ~ (p=0.739 n=12)
UnmarshalDataset/twitter-8                15.78k ± 0%   15.78k ± 0%       ~ (p=1.000 n=12)
UnmarshalDataset/code-8                   129.5k ± 0%   129.5k ± 0%       ~ (p=1.000 n=12) ¹
UnmarshalDataset/example-8                 399.0 ± 0%    399.0 ± 0%       ~ (p=1.000 n=12) ¹
Unmarshal/SimpleDocument/struct-8          2.000 ± 0%    2.000 ± 0%       ~ (p=1.000 n=12) ¹
Unmarshal/SimpleDocument/map-8             5.000 ± 0%    5.000 ± 0%       ~ (p=1.000 n=12) ¹
Unmarshal/ReferenceFile/struct-8           83.00 ± 0%    83.00 ± 0%       ~ (p=1.000 n=12) ¹
Unmarshal/ReferenceFile/map-8              194.0 ± 0%    194.0 ± 0%       ~ (p=1.000 n=12) ¹
Unmarshal/HugoFrontMatter-8                54.00 ± 0%    54.00 ± 0%       ~ (p=1.000 n=12) ¹
Marshal/SimpleDocument/struct-8            4.000 ± 0%    4.000 ± 0%       ~ (p=1.000 n=12) ¹
Marshal/SimpleDocument/map-8               4.000 ± 0%    4.000 ± 0%       ~ (p=1.000 n=12) ¹
Marshal/ReferenceFile/struct-8             4.000 ± 0%    4.000 ± 0%       ~ (p=1.000 n=12) ¹
Marshal/ReferenceFile/map-8                91.00 ± 0%    91.00 ± 0%       ~ (p=1.000 n=12) ¹
Marshal/HugoFrontMatter-8                  20.00 ± 0%    20.00 ± 0%       ~ (p=1.000 n=12) ¹
RealWorldContainerdConfig-8                144.0 ± 0%    144.0 ± 0%       ~ (p=1.000 n=12) ¹
RealWorldViperRead-8                       65.00 ± 0%    65.00 ± 0%       ~ (p=1.000 n=12) ¹
RealWorldViperWrite-8                      33.00 ± 0%    33.00 ± 0%       ~ (p=1.000 n=12) ¹
RealWorldHugoFrontMatterBatch-8            820.0 ± 0%    820.0 ± 0%       ~ (p=1.000 n=12) ¹
RealWorldGitleaksRules-8                   259.0 ± 0%    259.0 ± 0%       ~ (p=1.000 n=12) ¹
RealWorldPyproject-8                       142.0 ± 0%    142.0 ± 0%       ~ (p=1.000 n=12) ¹
RealWorldGolangciStrict-8                  48.00 ± 0%    48.00 ± 0%       ~ (p=1.000 n=12) ¹
geomean                                    211.1         211.1       +0.00%
¹ all samples are equal

🤖 Generated with Claude Code

pelletier added a commit that referenced this pull request Jul 11, 2026
Benchmarking the Marshaler-interface commit (#1084) against v2 on
linux/amd64 (interleaved rounds, n=12, benchstat) showed statistically
significant sec/op regressions on the default (interface-disabled)
Marshal path — up to +10% on micro-benchmarks — with allocations
unchanged. Bisecting the diff piece by piece isolated the dominant
cause: widening the per-type typeEncProps cache struct from 2 to 3
bytes. Its cached p.(typeEncProps) assertion and by-value return run
two to three times per encoded value, and the extra field changes the
copy size and register shape of every lookup; that lone change
reproduced the regression with zero encoder-code modifications.

- typeEncProps and encPropsForType are restored to their exact baseline
  form. The unstable.Marshaler classification lives in its own
  sync.Map (typeMarshalerCache/marshalerPropsForType), consulted only
  on EnableMarshalerInterface paths.
- encodeTable, encodeKeyValue and encodeArrayTable are restored to
  their exact baseline source. The Marshaler-aware variants of the
  table passes live in encodeTableWithMarshalers and
  encodeArrayTableWithMarshalers, selected by one branch per table
  instead of one per entry. Marshaler values on a `key =` line flow
  through appendValue's gated guard, which returns without rejoining
  the fall-through path and re-classifies the fetched bytes (keeping
  the emit-time guard), so appendMarshalerInlineValue is gone.
- All Marshaler-interface machinery moves to a new marshaler_raw.go so
  the feature's cold code does not sit between the default path's hot
  functions.

After this change the interface-off encoder differs from baseline only
by four single-branch dispatches; typeEncProps, encPropsForType and the
hot encoder functions are byte-identical to the pre-#1084 source.
allocs/op are identical across the whole ./benchmark suite. Remaining
µs-scale sec/op deltas are within this host's address-alignment noise
floor, demonstrated by dead-code A/A controls and -randlayout runs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Issue asking for a new feature in go-toml.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support RawMessage for Partial Field Structs

1 participant