No description
2ce594e446
There are 8935901 *ninjaString objects generated in an AOSP aosp_blueline-userdebug build, and 7865180 of those are a literal string with no ninja variables. Each of those *ninjaString objects takes a minimum of 48 bytes for 2 slices, plus 8 bytes for the pointer to the ninjaString. For the literal string case, one of those slices has a single element, (costing another 16 bytes for the backing array), and the other slice is empty, for a total of 72 bytes. Replace *ninjaString with a ninjaString interface. This increases the size of the reference from 8 bytes to 16 bytes, but using a type alias of a string for the literal string implementation uses only 16 bytes, saving 40 bytes per literal string or 314 MB. Test: ninja_strings_test Change-Id: Ic5fe16ed1f2a244fe6a8ccdf762919634d825cbe |
||
---|---|---|
bootstrap | ||
bpfmt | ||
bpmodify | ||
deptools | ||
gotestmain | ||
gotestrunner | ||
loadplugins | ||
microfactory | ||
parser | ||
pathtools | ||
proptools | ||
tests | ||
.gitignore | ||
.travis.fix-fork.sh | ||
.travis.gofmt.sh | ||
.travis.install-ninja.sh | ||
.travis.yml | ||
blueprint.bash | ||
blueprint_impl.bash | ||
Blueprints | ||
bootstrap.bash | ||
context.go | ||
context_test.go | ||
CONTRIBUTING.md | ||
doc.go | ||
glob.go | ||
glob_test.go | ||
go.mod | ||
LICENSE | ||
live_tracker.go | ||
mangle.go | ||
module_ctx.go | ||
module_ctx_test.go | ||
name_interface.go | ||
ninja_defs.go | ||
ninja_strings.go | ||
ninja_strings_test.go | ||
ninja_writer.go | ||
ninja_writer_test.go | ||
package_ctx.go | ||
README.md | ||
scope.go | ||
singleton_ctx.go | ||
splice_modules_test.go | ||
visit_test.go |
Blueprint Build System
Blueprint is a meta-build system that reads in Blueprints files that describe modules that need to be built, and produces a Ninja manifest describing the commands that need to be run and their dependencies. Where most build systems use built-in rules or a domain-specific language to describe the logic for converting module descriptions to build rules, Blueprint delegates this to per-project build logic written in Go. For large, heterogenous projects this allows the inherent complexity of the build logic to be maintained in a high-level language, while still allowing simple changes to individual modules by modifying easy to understand Blueprints files.