]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/internal/goobj2: change StringRef encoding for better locality
authorCherry Zhang <cherryyz@google.com>
Wed, 1 Apr 2020 00:01:46 +0000 (20:01 -0400)
committerCherry Zhang <cherryyz@google.com>
Wed, 1 Apr 2020 18:27:36 +0000 (18:27 +0000)
commitff29f97437765abb4dd47a239c3cca274175d5e0
tree335b347640647210afb5f545eff85c71deec5721
parent4ec5e7c50fb2d7fb158578e620e026779c3aafe3
[dev.link] cmd/internal/goobj2: change StringRef encoding for better locality

Previously, StringRef is encoded as an offset pointing to
{ len, [len]byte }. This CL changes it to { len, offset }, where
offset points the bytes.

With the new format, reading a string header is just reading two
adjacent uint32s, without accessing the string table. This should
improve locality of object file reading.

Change-Id: Iec30708f9d9adb2f0242db6c4767c0f8e730f4df
Reviewed-on: https://go-review.googlesource.com/c/go/+/226797
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/internal/goobj2/objfile.go