Commit 38411d3c authored by Jasper Chapman-Black's avatar Jasper Chapman-Black Committed by Commit Bot

Reland: Reland: SuperSize: 3x speedup by minimizing string allocations

Bug: 1011921
Change-Id: I33b2f87730acfcee33a19bc143e9fe92bf7aba36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874229Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Jasper Chapman-Black <jaspercb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708335}
parent 8894a3f3
......@@ -23,8 +23,10 @@ python_library("sizes_py") {
]
}
group("caspian") {
deps = [
"//tools/binary_size/libsupersize/caspian:cli($host_toolchain)",
]
if (is_linux) {
group("caspian") {
deps = [
"//tools/binary_size/libsupersize/caspian:cli($host_toolchain)",
]
}
}
......@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
assert(is_linux)
source_set("caspian-lib") {
sources = [
"file_format.cc",
......
......@@ -8,7 +8,6 @@
#include <stdlib.h>
#include <deque>
#include <string>
#include <vector>
#include "third_party/jsoncpp/source/include/json/json.h"
......@@ -25,13 +24,11 @@ struct Symbol {
int32_t size = 0;
int32_t flags = 0;
int32_t padding = 0;
std::string full_name;
std::string template_name;
std::string name;
const std::string* object_path = nullptr;
const std::string* section_name = nullptr;
const std::string* source_path = nullptr;
const std::string* component = nullptr;
const char* full_name = nullptr;
const char* section_name = nullptr;
const char* object_path = nullptr;
const char* source_path = nullptr;
const char* component = nullptr;
std::vector<Symbol*>* aliases = nullptr;
};
......@@ -45,11 +42,11 @@ struct SizeInfo {
Json::Value metadata;
// Entries in |raw_symbols| hold pointers to this data.
// Appending to one will change their capacity and invalidate pointers.
std::vector<std::string> object_paths;
std::vector<std::string> source_paths;
std::vector<std::string> components;
std::vector<std::string> section_names;
std::vector<const char*> object_paths;
std::vector<const char*> source_paths;
std::vector<const char*> components;
std::vector<const char*> section_names;
std::vector<char> raw_decompressed;
// A container for each symbol group.
std::deque<std::vector<Symbol*>> alias_groups;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment