Skip to content

Commit 4aea2cd

Browse files
authored
replace intermediate map in MarshalJSON with pair+pool (#1667)
1 parent 7f8e202 commit 4aea2cd

11 files changed

Lines changed: 1183 additions & 539 deletions

File tree

Changes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ v3 has many incompatibilities with v2. To see the full list of differences betwe
55
v2 and v3, please read the Changes-v3.md file (https://github.com/lestrrat-go/jwx/blob/develop/v3/Changes-v3.md)
66

77
v3.0.14 UNRELEASED
8+
* [jws][jwe][jwk] Replace intermediate map[string]any allocation in
9+
MarshalJSON with a pair-slice + sync.Pool pattern, matching the approach
10+
already used in jwt. Eliminates per-call map and key-slice allocations
11+
in the serialization hot path.
12+
813
* [jwt][jwe][jws][jwk] Fix inconsistent mutex locking across main data
914
structures. Named getters on JWK key types, MarshalJSON on JWK keys,
1015
UnmarshalJSON on JWE headers, makePairs/MarshalJSON on JWT tokens,

jwe/headers_gen.go

Lines changed: 136 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)