Skip to content

deps: bump to go-criu v8.3.0, drop google protobuf#5312

Merged
AkihiroSuda merged 1 commit into
opencontainers:mainfrom
kolyshkin:test-go-criu-protobuf-go-lite
Jun 18, 2026
Merged

deps: bump to go-criu v8.3.0, drop google protobuf#5312
AkihiroSuda merged 1 commit into
opencontainers:mainfrom
kolyshkin:test-go-criu-protobuf-go-lite

Conversation

@kolyshkin

@kolyshkin kolyshkin commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

go-criu v8.3.0 partially switches to protobuf-go-lite 1, which helps
to remove google.golang.org/protobuf dependency from here,
reducing the runc binary size from ~16M to ~14M.

The only missing piece is proto.String, proto.Bool, proto.Int32 etc.
helpers that return a pointer to a given variable. Those are replaced
by a generic mkPtr, which in turn is to be replaced by the new builtin
once Go < 1.26 is no longer supported.

@kolyshkin

kolyshkin commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Here's the size comparison via gsa. Here

TL;DR: new binary is ~12% (~2MB) smaller (16 -> 14 MB).

┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ Diff between runc.go-criu-v8.2.0 and runc                                               │
├──────────┬──────────────────────────────────────────────┬──────────┬──────────┬─────────┤
│ PERCENT  │ NAME                                         │ OLD SIZE │ NEW SIZE │ DIFF    │
├──────────┼──────────────────────────────────────────────┼──────────┼──────────┼─────────┤
│ +382.76% │ github.com/checkpoint-restore/go-criu/v8     │ 110 kB   │ 533 kB   │ +422 kB │
│ +100%    │ github.com/aperturerobotics/protobuf-go-lite │          │ 3.8 kB   │ +3.8 kB │
  .... (skipped diffs < 1KB) ....
│ -7.82%   │ <unnamed:generated>                          │ 161 kB   │ 148 kB   │ -13 kB  │
│ -4.26%   │ runtime                                      │ 1.4 MB   │ 1.3 MB   │ -58 kB  │
│ -100%    │ google.golang.org/protobuf                   │ 1.5 MB   │          │ -1.5 MB │
├──────────┼──────────────────────────────────────────────┼──────────┼──────────┼─────────┤
│ +104.01% │ .gopclntab                                   │ 49 kB    │ 99 kB    │ +50 kB  │
│ -1.98%   │ .noptrdata                                   │ 30 kB    │ 30 kB    │ -600 B  │
│ -2.37%   │ .rodata                                      │ 90 kB    │ 88 kB    │ -2.1 kB │
│ -12.67%  │ .data                                        │ 81 kB    │ 71 kB    │ -10 kB  │
│ -19.39%  │ .data.rel.ro                                 │ 266 kB   │ 214 kB   │ -52 kB  │
├──────────┼──────────────────────────────────────────────┼──────────┼──────────┼─────────┤
│ -11.72%  │ runc.go-criu-v8.2.0                          │ 16 MB    │ 14 MB    │ -1.9 MB │
│          │ runc                                         │          │          │         │
└──────────┴──────────────────────────────────────────────┴──────────┴──────────┴─────────┘

@kolyshkin kolyshkin force-pushed the test-go-criu-protobuf-go-lite branch 2 times, most recently from 9dafe90 to 7073ab8 Compare June 5, 2026 22:20
@kolyshkin kolyshkin force-pushed the test-go-criu-protobuf-go-lite branch from 7073ab8 to e25e64b Compare June 15, 2026 17:14
@kolyshkin

Copy link
Copy Markdown
Contributor Author
[kir@kir-tp1 runc]$ ls -l runc runc.after 
-rwxr-xr-x. 1 kir kir 16189280 Jun 15 10:14 runc
-rwxr-xr-x. 1 kir kir 14295872 Jun 15 10:14 runc.after

[kir@kir-tp1 runc]$ ls -lh runc runc.after 
-rwxr-xr-x. 1 kir kir 16M Jun 15 10:14 runc
-rwxr-xr-x. 1 kir kir 14M Jun 15 10:14 runc.after

[kir@kir-tp1 runc]$ size runc runc.after  | column -t
text      data     bss       dec       hex      filename
10102612  1453705  33786120  45342437  2b3dee5  runc
8989599   1243465  33783560  44016624  29fa3f0  runc.after

@kolyshkin

kolyshkin commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Reducing the binary size helps rootless execution times, since we spend about 1/3 of runc exec copying our binary via sendfile (last time I checked).

[kir@kir-tp1 runc-rootless]$ hyperfine './runc exec 1234 /bin/true' './runc.after exec 1234 /bin/true' './runc exec 1234 /bin/true'
Benchmark 1: ./runc exec 1234 /bin/true
  Time (mean ± σ):      13.2 ms ±   1.4 ms    [User: 4.5 ms, System: 11.0 ms]
  Range (min … max):    10.6 ms …  20.8 ms    228 runs
 
Benchmark 2: ./runc.after exec 1234 /bin/true
  Time (mean ± σ):      12.3 ms ±   1.3 ms    [User: 4.2 ms, System: 10.4 ms]
  Range (min … max):     9.6 ms …  20.6 ms    248 runs
 
Benchmark 3: ./runc exec 1234 /bin/true
  Time (mean ± σ):      13.4 ms ±   1.3 ms    [User: 4.4 ms, System: 11.4 ms]
  Range (min … max):    10.6 ms …  18.6 ms    236 runs
 
Summary
  ./runc.after exec 1234 /bin/true ran
    1.07 ± 0.16 times faster than ./runc exec 1234 /bin/true
    1.09 ± 0.15 times faster than ./runc exec 1234 /bin/true

@kolyshkin kolyshkin changed the title [DO NOT MERGE] test go-criu protobuf-go-lite branch [DNM] deps: bump to go-criu v8.3.0 Jun 15, 2026
@kolyshkin kolyshkin force-pushed the test-go-criu-protobuf-go-lite branch from e25e64b to a4be9b0 Compare June 15, 2026 19:08
@kolyshkin kolyshkin changed the title [DNM] deps: bump to go-criu v8.3.0 deps: bump to go-criu v8.3.0, drop google protobuf dep Jun 15, 2026
go-criu v8.3.0 switches to protobuf-go-lite, which helps to remove
google.golang.org/protobuf dependency from here, reducing the runc
binary size from ~16M to ~14M.

The only missing piece is proto.String, proto.Bool, proto.Int32 etc.
helpers that return a pointer to a given variable. Those are replaced
by a generic mkPtr, which in turn is to be replaced by the new builtin
once Go < 1.26 is no longer supported.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin kolyshkin force-pushed the test-go-criu-protobuf-go-lite branch from a4be9b0 to f66ace4 Compare June 15, 2026 19:09
@kolyshkin kolyshkin marked this pull request as ready for review June 15, 2026 19:09
@kolyshkin kolyshkin changed the title deps: bump to go-criu v8.3.0, drop google protobuf dep deps: bump to go-criu v8.3.0, drop google protobuf Jun 15, 2026

@rata rata left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kolyshkin awesome! LGTM, thanks!!

@rata

rata commented Jun 15, 2026

Copy link
Copy Markdown
Member

CRIU repos seem broken :(

@kolyshkin

Copy link
Copy Markdown
Contributor Author

CRIU repos seem broken :(

Yeah this part (installing criu from OBS or launchpad) was always more brittle.

@kolyshkin

Copy link
Copy Markdown
Contributor Author

I think the chance of c/r breakage is very low and we can backport this to 1.5.0; wdyt @cyphar ?

@kolyshkin

Copy link
Copy Markdown
Contributor Author

@opencontainers/runc-maintainers PTAL

@kolyshkin kolyshkin added the backport/1.5-todo A PR in main branch which needs to be backported to release-1.5 label Jun 17, 2026
@kolyshkin kolyshkin added this to the 1.5.0 milestone Jun 17, 2026
@AkihiroSuda AkihiroSuda merged commit c6f4361 into opencontainers:main Jun 18, 2026
82 of 95 checks passed
@thaJeztah

Copy link
Copy Markdown
Member

Nice! TIL about https://github.com/aperturerobotics/protobuf-go-lite - looks interesting

@kolyshkin kolyshkin added backport/1.5-done A PR in main branch which has been backported to release-1.5 and removed backport/1.5-todo A PR in main branch which needs to be backported to release-1.5 labels Jun 18, 2026
@kolyshkin

Copy link
Copy Markdown
Contributor Author

Nice! TIL about https://github.com/aperturerobotics/protobuf-go-lite - looks interesting

The use case is small(ish) -- embedded stuff (where memory and disk space are tight) and tools like runc, where we should really try to keep the binary size down because we copy it for every run/start/exec (currently only for rootless).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/1.5-done A PR in main branch which has been backported to release-1.5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants