Lower std::deque block size.

It was discovered that libc++ implementation of std::deque allocates
in 4KiB blocks, so it uses 4KiB even to store a single element. That
wastes massive amounts of memory in several cases, see the bug and
docs it links to.

There are several ways to fix this (see comment #26 in the bug), but
the easiest one is to just patch the NDK. We decided to fix the issue
upstream first, so bugs.llvm.org/show_bug.cgi?id=32435 was filed.

However, the LLVM bug has stalled, and it's unclear how long it will
take us to make the change. At the same time pressure to reduce Chrome
memory usage on low-end devices has increased following the Android Go
announcement.

So here is the new plan:
  1. Temporarily patch NDK to lower deque's block size
  2. Monitor memory and performance dashboards for regressions
  3. Decide whether to keep the lower block size
  4. Submit findings to the LLVM bug

Bug: 674287
Change-Id: Idf7ad7eab5ab1ea6a66902bc5069745e56079cf4
Reviewed-on: https://chromium-review.googlesource.com/514207
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Tested-by: Dmitry Skiba <dskiba@chromium.org>
1 file changed