diff options
| author | Mark Freeman <mark@golang.org> | 2025-05-21 15:13:45 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-05-21 13:39:06 -0700 |
| commit | b6e251b264869fac4ddc158fb9a5c8d5b4ac086f (patch) | |
| tree | ba376c6b74b0dd2ab895eb9091c8ca57714e985e /src/internal | |
| parent | a1a151496503cafa5e4c672e0e9c1e1bb3516702 (diff) | |
| download | go-b6e251b264869fac4ddc158fb9a5c8d5b4ac086f.tar.xz | |
internal/pkgbits: mark element / section ends as delta encoding candidates
Change-Id: I165c98a0a5800515bfa33c60b95b534900d0ea59
Reviewed-on: https://go-review.googlesource.com/c/go/+/675215
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Mark Freeman <mark@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Diffstat (limited to 'src/internal')
| -rw-r--r-- | src/internal/pkgbits/encoder.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/internal/pkgbits/encoder.go b/src/internal/pkgbits/encoder.go index 2ecac1c788..6e3716570f 100644 --- a/src/internal/pkgbits/encoder.go +++ b/src/internal/pkgbits/encoder.go @@ -72,14 +72,17 @@ func (pw *PkgEncoder) DumpTo(out0 io.Writer) (fingerprint [8]byte) { writeUint32(flags) } - // Write elemEndsEnds. + // TODO(markfreeman): Also can use delta encoding to write section ends, + // but not as impactful. var sum uint32 for _, elems := range &pw.elems { sum += uint32(len(elems)) writeUint32(sum) } - // Write elemEnds. + // TODO(markfreeman): Use delta encoding to store element ends and inflate + // back to this representation during decoding; the numbers will be much + // smaller. sum = 0 for _, elems := range &pw.elems { for _, elem := range elems { |
