third_party.pigweed.src/pw_string/size_report/BUILD.gn

139 lines
3.2 KiB
Plaintext
Raw Normal View History

Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
# Copyright 2019 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
# gn-format disable
import("//build_overrides/pigweed.gni")
Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
import("$dir_pigweed/legacy_target.gni")
import("$dir_pw_build/target_types.gni")
Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
pw_executable("single_write_snprintf") {
sources = [ "format_single.cc" ]
Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
deps = [
"$dir_pw_bloat:bloat_this_binary",
Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
"..",
]
defines = [ "USE_FORMAT=0" ]
}
pw_executable("single_write_format") {
sources = [ "format_single.cc" ]
Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
deps = [
"$dir_pw_bloat:bloat_this_binary",
Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
"..",
]
defines = [ "USE_FORMAT=1" ]
}
pw_executable("multiple_writes_snprintf") {
sources = [ "format_multiple.cc" ]
Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
deps = [
"$dir_pw_bloat:bloat_this_binary",
Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
"..",
]
defines = [ "USE_FORMAT=0" ]
}
pw_executable("multiple_writes_format") {
sources = [ "format_multiple.cc" ]
Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
deps = [
"$dir_pw_bloat:bloat_this_binary",
Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
"..",
]
defines = [ "USE_FORMAT=1" ]
}
pw_executable("many_writes_snprintf") {
sources = [ "format_many_without_error_handling.cc" ]
Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
deps = [
"$dir_pw_bloat:bloat_this_binary",
Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
"..",
]
defines = [ "USE_FORMAT=0" ]
}
pw_executable("many_writes_format") {
sources = [ "format_many_without_error_handling.cc" ]
Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
deps = [
"$dir_pw_bloat:bloat_this_binary",
Size report for pw::string::Format Add size report comparing pw::string::Format to std::snprintf. Report with arm-none-eabi-gcc at -Os: Using pw::string::Format instead of snprintf ──────────────────────────────────────────── ┌────────────────────────────┬───────────┬────────┬───────┬────────┐ │ Label │ Segment │ Before │ Delta │ After │ ├════════════════════════════┼═══════════┼════════┼═══════┼════════┤ │ One string, return size │ SEG FLASH │ 2,840 │ +80 │ 2,920 │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Ten strings, handle errors │ (all) │ (same) │ 0 │ (same) │ ├────────────────────────────┼───────────┼────────┼───────┼────────┤ │ Fifty calls, same buffer │ SEG FLASH │ 3,816 │ -72 │ 3,744 │ └────────────────────────────┴───────────┴────────┴───────┴────────┘ Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-15 20:03:57 +00:00
"..",
]
defines = [ "USE_FORMAT=1" ]
}
pw_executable("build_string_with_snprintf_no_base_snprintf") {
sources = [ "string_builder_size_report.cc" ]
deps = [
"$dir_pw_bloat:bloat_this_binary",
"..",
]
defines = [
"USE_STRING_BUILDER=0",
"PROVIDE_BASE_SNPRINTF=0",
]
}
pw_executable("build_string_with_string_builder_no_base_snprintf") {
sources = [ "string_builder_size_report.cc" ]
deps = [
"$dir_pw_bloat:bloat_this_binary",
"..",
]
defines = [
"USE_STRING_BUILDER=1",
"PROVIDE_BASE_SNPRINTF=0",
]
}
pw_executable("build_string_with_snprintf") {
sources = [ "string_builder_size_report.cc" ]
deps = [
"$dir_pw_bloat:bloat_this_binary",
"..",
]
defines = [
"USE_STRING_BUILDER=0",
"PROVIDE_BASE_SNPRINTF=1",
]
}
pw_executable("build_string_with_string_builder") {
sources = [ "string_builder_size_report.cc" ]
deps = [
"$dir_pw_bloat:bloat_this_binary",
"..",
]
defines = [
"USE_STRING_BUILDER=1",
"PROVIDE_BASE_SNPRINTF=1",
]
}
pw_executable("build_string_incremental_with_snprintf") {
sources = [ "string_builder_size_report_incremental.cc" ]
deps = [
"$dir_pw_bloat:bloat_this_binary",
"..",
]
defines = [ "USE_STRING_BUILDER=0" ]
}
pw_executable("build_string_incremental_with_string_builder") {
sources = [ "string_builder_size_report_incremental.cc" ]
deps = [
"$dir_pw_bloat:bloat_this_binary",
"..",
]
defines = [ "USE_STRING_BUILDER=1" ]
}