You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article outlines various strategies for speeding up Go builds, making them significantly faster. It highlights practical steps such as reducing binary size, leveraging caching effectively, and parallelizing builds. The authors detail their hands-on experience with optimization and provide insights into how incremental builds, build tags, and avoiding cgo can lead to faster build times. These techniques are particularly useful for teams looking to streamline their development and deployment processes in projects using the Go programming language.
🖇️ Details
Title: Debugging Go compiler performance in a large codebase
This article provides a good idea for deep optimization of the go build compilation process (although the projects I am currently encountering have not reached such requirements 🙃). Here are two interesting points to note:
By passing some interesting flags (-debug-trace...) to go build, generate a trace file and import it into visualization tools like Perfetto for targeted compilation optimization
-debug-trace - this produces a trace, which can be visualised in a tool like Perfetto.
Using depguard (a great linter that can rule out import cycles), restrict pkg/domain from importing anything beyond the standard library
linters:
enable:
- depguard
- ...linter-settings:
depguard:
rules:
domain-no-deps:
files:
# this rule applies to anything within pkg/domain
- "**/pkg/domain/***"# Exclude any test files which can import whateverthey like
- "!$test"allow:
- "$gostd"
The text was updated successfully, but these errors were encountered:
🤖 AI Summary
This article outlines various strategies for speeding up Go builds, making them significantly faster. It highlights practical steps such as reducing binary size, leveraging caching effectively, and parallelizing builds. The authors detail their hands-on experience with optimization and provide insights into how incremental builds, build tags, and avoiding cgo can lead to faster build times. These techniques are particularly useful for teams looking to streamline their development and deployment processes in projects using the Go programming language.
🖇️ Details
🔖 Note
This article provides a good idea for deep optimization of the
go build
compilation process (although the projects I am currently encountering have not reached such requirements 🙃). Here are two interesting points to note:By passing some interesting flags (
-debug-trace
...) togo build
, generate a trace file and import it into visualization tools like Perfetto for targeted compilation optimization-debug-actiongraph
- this tells you what the compiler is doing at different points, and can be inspected with https://github.com/icio/actiongraph.-debug-trace
- this produces a trace, which can be visualised in a tool like Perfetto.Using depguard (a great linter that can rule out import cycles), restrict pkg/domain from importing anything beyond the standard library
The text was updated successfully, but these errors were encountered: