diff options
author | Wyatt Hepler <hepler@google.com> | 2019-11-19 17:10:20 -0800 |
---|---|---|
committer | Wyatt Hepler <hepler@google.com> | 2019-11-26 21:27:22 +0000 |
commit | fe85de25cf7ee185cf3eff0fe76080f440db1f10 (patch) | |
tree | bb4ad1acac3ecb39d75e8792fe00c04094db169c /pw_string/BUILD.gn | |
parent | 95ea1fe3c69273debffd3647f42c483f73b92fec (diff) | |
download | pigweed-fe85de25cf7ee185cf3eff0fe76080f440db1f10.tar.gz |
pw_string: start docs; StringBuilder size report
Change-Id: Id1dbc070b14a85aeb782606e85d566ed0347fcd4
Diffstat (limited to 'pw_string/BUILD.gn')
-rw-r--r-- | pw_string/BUILD.gn | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/pw_string/BUILD.gn b/pw_string/BUILD.gn index 1e5481be1..31481cc99 100644 --- a/pw_string/BUILD.gn +++ b/pw_string/BUILD.gn @@ -13,6 +13,7 @@ # the License. import("$dir_pw_bloat/bloat.gni") +import("$dir_pw_docgen/docs.gni") import("$dir_pw_unit_test/test.gni") config("default_config") { @@ -103,6 +104,16 @@ pw_test("util_test") { ] } +pw_doc_group("docs") { + sources = [ + "docs.rst", + ] + report_deps = [ + ":format_size_report", + ":string_builder_size_report", + ] +} + pw_size_report("format_size_report") { title = "Using pw::string::Format instead of snprintf" @@ -110,17 +121,39 @@ pw_size_report("format_size_report") { { target = "size_report:single_write_format" base = "size_report:single_write_snprintf" - label = "One string, return size" + label = "Format instead of snprintf once, return size" }, { target = "size_report:multiple_writes_format" base = "size_report:multiple_writes_snprintf" - label = "Ten strings, handle errors" + label = "Format instead of snprintf 10 times, handle errors" }, { target = "size_report:many_writes_format" base = "size_report:many_writes_snprintf" - label = "Fifty calls, same buffer" + label = "Format instead of snprintf 50 times, no error handling" + }, + ] +} + +pw_size_report("string_builder_size_report") { + title = "Using pw::StringBuilder instead of snprintf" + + binaries = [ + { + target = "size_report:build_string_with_string_builder" + base = "size_report:build_string_with_snprintf" + label = "Total StringBuilder cost when used alongside snprintf" + }, + { + target = "size_report:build_string_with_string_builder_no_base_snprintf" + base = "size_report:build_string_with_snprintf_no_base_snprintf" + label = "StringBuilder cost when completely replacing snprintf" + }, + { + target = "size_report:build_string_incremental_with_string_builder" + base = "size_report:build_string_incremental_with_snprintf" + label = "Incremental cost relative to snprintf for 10 strings" }, ] } |