diff options
| author | Cherry Mui <cherryyz@google.com> | 2023-04-21 16:28:57 -0400 |
|---|---|---|
| committer | Cherry Mui <cherryyz@google.com> | 2023-04-24 16:50:28 +0000 |
| commit | ddd822e5ca0e686ae64d921bcfe28119c34278fb (patch) | |
| tree | 1da75519171be755d58e66279525276174c8db81 /src/testing/slogtest | |
| parent | d33a5136e1a4513a3b1deacf1cc0677e070c7e8f (diff) | |
| download | go-ddd822e5ca0e686ae64d921bcfe28119c34278fb.tar.xz | |
cmd/link: don't sort data symbols by name
For data symbols, we currently sort them by size, then by name if
the size is the same. Sorting by name is not really necessary.
Instead, we sort by symbol index. Like name, the symbol index is
deterministic, and pretty stable if only a small portion of the
input is changed, and also naturally partitioned by packages. This
reduces the CPU time for reading the symbol names and comparing
strings.
Linking cmd/compile (on macOS/amd64),
Dodata 57.2ms ± 6% 54.5ms ± 4% -4.74% (p=0.000 n=19+17)
Change-Id: I1c4f2b83dbbb4b984b2c8ab4a7e8543b9f7f22b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/487515
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/testing/slogtest')
0 files changed, 0 insertions, 0 deletions
