>>> Print(size_info.symbols.WhereNameMatches(r'std::.*vector'))
Showing 4,099 symbols (2,447 unique) with total pss: 417605 bytes
.text=407kb .rodata=0 bytes .data*=0 bytes .bss=0 bytes total=407kb
Number of unique paths: 1385
>>> vector_syms = canned_queries.TemplatesByName().WhereNameMatches('vector')
>>> Print(vector_syms)
Showing 24 symbols (24 unique) with total pss: 417765 bytes
.text=407kb .rodata=0 bytes .data*=0 bytes .bss=0 bytes total=407kb
Number of unique paths: 1385
Index, Running Total, Section@Address, PSS
------------------------------------------------------------
0) 157674 (37.7%) *@Group 157674 std::__ndk1::vector::__push_back_slow_path (count=1782)
1) 219886 (52.6%) *@Group 62212 std::__ndk1::vector::insert (count=170)
2) 273534 (65.5%) *@Group 53648 std::__ndk1::vector::assign (count=229)
3) 321600 (77.0%) *@Group 48065 std::__ndk1::vector::__append (count=252)
4) 340658 (81.5%) *@Group 19057 std::__ndk1::vector::__emplace_back_slow_path (count=128)
5) 357022 (85.5%) *@Group 16364 std::__ndk1::__vector_base::~__vector_base (count=741)
6) 371468 (88.9%) *@Group 14446 std::__ndk1::vector::__swap_out_circular_buffer (count=266)
7) 383936 (91.9%) *@Group 12468 std::__ndk1::vector::vector (count=204)
8) 396388 (94.9%) *@Group 12452 std::__ndk1::vector::emplace (count=27)
9) 401998 (96.2%) *@Group 5610 std::__ndk1::vector::__construct_at_end (count=86)
10) 406456 (97.3%) *@Group 4457 std::__ndk1::vector::reserve (count=54)
11) 410156 (98.2%) *@Group 3700 std::__ndk1::vector::resize (count=42)
12) 412626 (98.8%) *@Group 2470 std::__ndk1::vector::erase (count=24)
13) 414746 (99.3%) *@Group 2120 std::__ndk1::vector::__move_range (count=17)
14) 416082 (99.6%) *@Group 1336 std::__ndk1::vector::deallocate (count=29)
15) 416834 (99.8%) *@Group 752 std::__ndk1::vector::__move_assign (count=11)
16) 417254 (99.9%) *@Group 419 std::__ndk1::vector::allocate (count=25)
17) 417440 (99.9%) *@Group 186 std::__ndk1::vector::push_back (count=1)
18) 417600 (100.0%) *@Group 160 google_breakpad::wasteful_vector::wasteful_vector (count=2)
19) 417680 (100.0%) *@Group 80 std::__ndk1::__vector_base_common::__throw_length_error const (count=1)
20) 417709 (100.0%) *@Group 29 std::__ndk1::vector::~vector (count=5)
21) 417729 (100.0%) *@Group 20 std::__ndk1::vector::clear (count=1)
22) 417747 (100.0%) *@Group 18 std::__ndk1::vector::max_size const (count=2)
23) 417765 (100.0%) *@Group 17 std::__ndk1::vector::swap (count=2)
>>> Print(vector_syms[0], verbose=True)
Showing 1,782 symbols (787 unique) with total pss: 157674 bytes
.text=153kb .rodata=0 bytes .data*=0 bytes .bss=0 bytes total=153kb
Number of unique paths: 926
Index, Running Total, Section@Address, PSS
------------------------------------------------------------
0) 520 (0.3%) t@0x14fe3e0 pss=520 padding=0 size_without_padding=520
source_path=v8/src/wasm/module-decoder.cc object_path=v8/v8_base/module-decoder.o
flags={} name=std::__ndk1::vector::__push_back_slow_path
full_name=std::__ndk1::vector<v8::internal::wasm::WasmIndirectFunctionTable, std::__ndk1::allocator<v8::internal::wasm::WasmIndirectFunctionTable> >::__push_back_slow_path<v8::internal::wasm::WasmIndirectFunctionTable>(v8::internal::wasm::WasmIndirectFunctionTable&&)
1) 1036 (0.7%) t@0xb50a2c pss=516 padding=0 size_without_padding=516
source_path=third_party/skia/src/core/SkColorSpace_ICC.cpp object_path=skia/skia/SkColorSpace_ICC.o
flags={} name=std::__ndk1::vector::__push_back_slow_path
full_name=std::__ndk1::vector<SkColorSpace_A2B::Element, std::__ndk1::allocator<SkColorSpace_A2B::Element> >::__push_back_slow_path<SkColorSpace_A2B::Element>(SkColorSpace_A2B::Element&&)
2) 1536 (1.0%) t@0xe8d1b0 pss=500 padding=0 size_without_padding=500
source_path=cc/trees/property_tree.cc object_path=cc/cc/property_tree.o
flags={} name=std::__ndk1::vector::__push_back_slow_path
full_name=std::__ndk1::vector<cc::DrawTransformData, std::__ndk1::allocator<cc::DrawTransformData> >::__push_back_slow_path<cc::DrawTransformData>(cc::DrawTransformData&&)
>>> Print(vector_syms[0].WhereFullNameMatches(r'vector<[^<]*\*').GroupedByName())
Showing 1 symbols (1 unique) with total pss: 1265 bytes
.text=1265 bytes .rodata=0 bytes .data*=0 bytes .bss=0 bytes total=1265 bytes
Number of unique paths: 307
Index, Running Total, Section@Address, PSS
------------------------------------------------------------
0) 1265 (100.0%) *@Group 1265 std::__ndk1::vector::__push_back_slow_path (count=442)
>>> Print(vector_syms[0].WhereFullNameMatches(r'vector<[^<]*_ptr\b').GroupedByName())
Showing 1 symbols (1 unique) with total pss: 21619 bytes
.text=21.1kb .rodata=0 bytes .data*=0 bytes .bss=0 bytes total=21.1kb
Number of unique paths: 193
Index, Running Total, Section@Address, PSS
------------------------------------------------------------
0) 21619 (100.0%) *@Group 21619 std::__ndk1::vector::__push_back_slow_path (count=304)
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABiQX1WHpgiwGwVHKk3BL0-ntVR8Kyy-FnKdusbu%3DR0%2BDy614A%40mail.gmail.com.
- Use templated collection classes on non-pointer types only when there is real performance need for it.
--Should have some serious thought about whether they really need to be allocated directly in the collection as opposed to on the head (even within a smart pointer... I really am assuming that overhead is fixable with compilers).--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABiQX1WHpgiwGwVHKk3BL0-ntVR8Kyy-FnKdusbu%3DR0%2BDy614A%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABiQX1XYxjHp5wbViG6yTfqzmuvKStHaZhEd%3D96nhQ8U_ua5jA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "binary-size" group.
To unsubscribe from this group and stop receiving emails from it, send an email to binary-size+unsubscribe@chromium.org.
To post to this group, send email to binar...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/binary-size/CABiQX1WHpgiwGwVHKk3BL0-ntVR8Kyy-FnKdusbu%3DR0%2BDy614A%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to binary-size...@chromium.org.
To post to this group, send email to binar...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/binary-size/CABiQX1WHpgiwGwVHKk3BL0-ntVR8Kyy-FnKdusbu%3DR0%2BDy614A%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMGbLiFq8OtRgT6kSeRRCDjP%2B71RaHjhBnFAJirx8oA%2Bsr2G0A%40mail.gmail.com.
Bottom-line:
- Using non-pointer types in vectors (especially non-PODs) has a real binary size cost, which affects all users, all the time, even when they are not running your code.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CALQVofosE4%3DwHSnHePUh2XrbrKantVOBh8TZY72zmy_Dq_K4sQ%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2B4qT31rtj0xcO2aGVVgrehMy7yGjYCZX0tYjwoPJRK_VMekmg%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "binary-size" group.
To unsubscribe from this group and stop receiving emails from it, send an email to binary-size...@chromium.org.
To post to this group, send email to binar...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/binary-size/CABiQX1V34s8XQ%3DC1HDyULGhYkK3mrS%2B5ueFzEH5KUKog-aeOpA%40mail.gmail.com.
While we got a few nice size wins (300 KB, 400KB-800KB) from uninlining CallbackBase and changing base::DictionaryValue to use StringPiece (to avoid implicit conversions to std::string all over the code), I never really saw anything to indicate it helped significantly with runtime speed. (It doesn't mean that they're not worth doing, and it could simply be that the things that changed weren't in sufficiently hot paths).
Also, I've noticed that binary size changes often have a reduced effect on Android. For example, removing the amount of implicit std::string objects generally had a negligible binary size impact on Android: see https://chromeperf.appspot.com/group_report?rev=414450. Is Android's standard library significantly different from other platforms? I thought it was libc++.Daniel
On Sat, May 20, 2017, 04:05 Andrew Grieve <agr...@chromium.org> wrote:
I think it's clearly been established that this is certainly overly-simplistic, and the answer is always "it depends".It's worth pointing out that locality matters for code as well though. The larger the code size, the more CPU is jumping around to get at instructions. If we could magically have only a single copy of all collection functions, I suspect there would be a real runtime speed boost from memory locality of the instructions.--On Thu, May 18, 2017 at 4:09 PM, Lucas Gadani <l...@chromium.org> wrote:On Thu, May 18, 2017 at 1:42 PM Andrew Grieve <agr...@chromium.org> wrote:Bottom-line:
- Using non-pointer types in vectors (especially non-PODs) has a real binary size cost, which affects all users, all the time, even when they are not running your code.
I think this recommendation is too simplistic. Using pointer types will incur the problems of reduced memory locality, extra allocator overhead, increased memory fragmentation.At which point does the allocator overhead and fragmentation will outweight the benefits of using pointer types, only from a memory perspective? Is it worth doing it just for the sake of reducing the binary size by a few kb?
You received this message because you are subscribed to the Google Groups "binary-size" group.
To unsubscribe from this group and stop receiving emails from it, send an email to binary-size+unsubscribe@chromium.org.
To post to this group, send email to binar...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/binary-size/CABiQX1V34s8XQ%3DC1HDyULGhYkK3mrS%2B5ueFzEH5KUKog-aeOpA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "binary-size" group.
To unsubscribe from this group and stop receiving emails from it, send an email to binary-size+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/binary-size/CAF3XrKonurq7NVr1-epkZJDvf6RcHCnpFTLVCm7xf-7ftVj%2Bfg%40mail.gmail.com.
Android builds with -Os, linux with -O2.
(We tried to unify that last week, but predictably it's not good for perf on Linux, see discussion on https://codereview.chromium.org/2883113002 . The list of benchmarks there that regressed is probably a list of metrics with optimization opportunity on Android...)
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/binary-size/CAMGbLiHV%2Bz0U4caKp4n4ToPdPTd_noJVwGVyE8G4r%3DOa5LY9rA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "binary-size" group.
To unsubscribe from this group and stop receiving emails from it, send an email to binary-size+unsubscribe@chromium.org.
To post to this group, send email to binar...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/binary-size/43f1287c-af1a-4ed0-ae00-a3ea7d93c6eb%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABiQX1W3zikDFzd_r_GxR-R72h4S6XweWbHPcdeW3oR2emb4cw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/binary-size/CACuR13fW744L0rJ0kZxMvPyhYMwgETvc293f9Un2Fgn51y96sQ%40mail.gmail.com.