Commit 8f02df76 authored by Brian Smith's avatar Brian Smith Committed by Brad Fitzpatrick
Browse files

encoding/xml: avoid an allocation for tags without attributes

Before, an array of size 4 would always be allocated even if a tag
doesn't have any attributes. Now that array is allocated only if
needed.

benchmark              old allocs     new allocs     delta
BenchmarkUnmarshal     191            176            -8.5%

Change-Id: I4d214b228883d0a6e892c0d6eb00dfe2da84c116
Reviewed-on: https://go-review.googlesource.com/4160


Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 3d56fe6d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment