Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys/syz-sysgen: serialize descriptions as gob and embed #5698

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

dvyukov
Copy link
Collaborator

@dvyukov dvyukov commented Jan 23, 2025

Instead of generating Go files with descriptions
serialize them as gob and compress with flate.

This significantly reduces build time, go vet time,
and solves scalability problems with some static analysis tools.

Reference times (all after rm -rf ~/.cache/go-build) before:

TIME="%e %P %M" time go install ./syz-manager
48.29 577% 4824820

TIME="%e %P %M" time go test -c ./prog
56.28 380% 6973292

After:

TIME="%e %P %M" time go install ./syz-manager
22.81 865% 859788

TIME="%e %P %M" time go test -c ./prog
12.74 565% 267760

syz-manager size before/after: 194712597 -> 83418407
-57% even provided we now embed all descriptions
instead of just a single arch.

Deflate/decoding time for a single Linux arch is ~330ms.

Fixes #5542

Instead of generating Go files with descriptions
serialize them as gob and compress with flate.

This significantly reduces build time, go vet time,
and solves scalability problems with some static analysis tools.

Reference times (all after rm -rf ~/.cache/go-build) before:

TIME="%e %P %M" time go install ./syz-manager
48.29 577% 4824820

TIME="%e %P %M" time go test -c ./prog
56.28 380% 6973292

After:

TIME="%e %P %M" time go install ./syz-manager
22.81 865% 859788

TIME="%e %P %M" time go test -c ./prog
12.74 565% 267760

syz-manager size before/after: 194712597 -> 83418407
-57% even provided we now embed all descriptions
instead of just a single arch.

Deflate/decoding time for a single Linux arch is ~330ms.

Fixes google#5542
@dvyukov dvyukov force-pushed the dyvukov-serialize-descriptions branch from e217255 to c5d31d5 Compare January 23, 2025 12:35
sys/generated/generated.go Show resolved Hide resolved
@dvyukov dvyukov added this pull request to the merge queue Jan 23, 2025
@a-nogikh
Copy link
Collaborator

It's especially cool to see the speedup of go test ./prog. It used to be so annoying to wait for the results :)

Merged via the queue into google:master with commit 79910ad Jan 23, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sys/syz-sysgen: generated Go files are too big
3 participants