commit | 1ac43bd65a55065fc9803af51344baa9d7fdff87 | [log] [tgz] |
---|---|---|
author | Francois Berder <francois.berder@arm.com> | Mon Jan 18 14:02:09 2021 +0000 |
committer | Francois Berder <francois.berder@arm.com> | Thu Jan 28 14:28:34 2021 +0000 |
tree | 2e80128b02a256ebf82103270b7c6603cb8af4d9 | |
parent | 53e92a0de6c2528401cbf5cf3b1be9958fbe99e9 [diff] |
Optimize HasTag function The commits optimizes HasTag function by avoiding the call to strings.Split that allocates a list of strings. HasTag is called from the ExtendProperties family of functions. So this new implementation would benefit any primary builder that extensively uses property appending. Add a small benchmark for HasTag function. It shows that HasTag is speed up by a factor of 2-3 with the new implementation. Before: goos: linux goarch: amd64 BenchmarkHasTag/NoTag-56 20000000 118 ns/op BenchmarkHasTag/EmptyTag-56 20000000 120 ns/op BenchmarkHasTag/OtherTag-56 10000000 131 ns/op BenchmarkHasTag/MatchingTag-56 10000000 177 ns/op BenchmarkHasTag/ExtraValues-56 5000000 392 ns/op BenchmarkHasTag/ExtraTags-56 10000000 183 ns/op After: goos: linux goarch: amd64 BenchmarkHasTag/NoTag-56 200000000 11.5 ns/op BenchmarkHasTag/EmptyTag-56 200000000 11.5 ns/op BenchmarkHasTag/OtherTag-56 50000000 25.2 ns/op BenchmarkHasTag/MatchingTag-56 20000000 61.4 ns/op BenchmarkHasTag/ExtraValues-56 20000000 94.3 ns/op BenchmarkHasTag/ExtraTags-56 20000000 79.1 ns/op Signed-off-by: Francois Berder <francois.berder@arm.com> Change-Id: Ib45498e9ad6aebeca2beddea63543da40c0b1a21
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.