aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Zuklie <rzuklie@google.com>2023-01-05 17:39:38 -0800
committerRyan Zuklie <rzuklie@google.com>2023-01-23 14:38:18 -0800
commit3ebbd9cfabd67eec1f2482288c2327b7caf544ec (patch)
tree41dbf55bec5a21bd92d7eee5baaa8ffadaa72418
parentcf104c4bd8fbf0450a1889475b67f137a4165dd6 (diff)
downloadperfetto-3ebbd9cfabd67eec1f2482288c2327b7caf544ec.tar.gz
Remove forced inlines within the proto decoder
These proto decoder methods are used within ParseFromArray in every Perfetto protobuf. Together they are 150+ lines of code which becomes 70KB of binary size when compiled. ddiproietto@'s benchmark showed no noticable performance drop without the inlining. Change-Id: Ieaaa72318ce4367711cee8bb68d610aefdb77fbc (cherry picked from commit 5e1db5ba320c00e80dcbeb7766e1775f243dd3a7) Merged-In: Ieaaa72318ce4367711cee8bb68d610aefdb77fbc
-rw-r--r--src/protozero/proto_decoder.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/protozero/proto_decoder.cc b/src/protozero/proto_decoder.cc
index a766a287a..0595c1ffc 100644
--- a/src/protozero/proto_decoder.cc
+++ b/src/protozero/proto_decoder.cc
@@ -46,8 +46,8 @@ struct ParseFieldResult {
// Parses one field and returns the field itself and a pointer to the next
// field to parse. If parsing fails, the returned |next| == |buffer|.
-PERFETTO_ALWAYS_INLINE ParseFieldResult
-ParseOneField(const uint8_t* const buffer, const uint8_t* const end) {
+ParseFieldResult ParseOneField(const uint8_t* const buffer,
+ const uint8_t* const end) {
ParseFieldResult res{ParseFieldResult::kAbort, buffer, Field{}};
// The first byte of a proto field is structured as follows:
@@ -172,7 +172,6 @@ Field ProtoDecoder::FindField(uint32_t field_id) {
return res;
}
-PERFETTO_ALWAYS_INLINE
Field ProtoDecoder::ReadField() {
ParseFieldResult res;
do {