Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Issue 1867653002: Initial version of Blimp BlobCache. (Closed)

Created:
4 years, 8 months ago by nyquist
Modified:
4 years, 8 months ago
Reviewers:
Kevin M, davidben, vmpstr
CC:
chromium-reviews, anandc+watch-blimp_chromium.org, maniscalco+watch-blimp_chromium.org, sriramsr+watch-blimp_chromium.org, nyquist+watch-blimp_chromium.org, marcinjb+watch-blimp_chromium.org, jessicag+watch-blimp_chromium.org, kmarshall+watch-blimp_chromium.org, cc-bugs_chromium.org, dtrainor+watch-blimp_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Initial version of Blimp BlobCache. Currently, every time there is a commit from engine to client, all pictures are sent again, leading to poor performance and high bandwidth usage. This CL adds a cache on the client side that never clears out any received resources. This means that the engine can depend on that the client has all resources it has previously sent, and uses this fact to only send down a unique identifier (SHA1 hash of the image) and the the width and height in place of the image itself. This is wrapped in the new proto BlobCacheImageMetadata. If this would be a new image for the client, the proto also includes the payload of the image. This payload will be removed when the BlobChannel is fully integrated. The identifier is calculated based on the source image, to ensure that no encode is required on the engine when the same image is seen again. To ensure that the cache is used for all images, this changes the behavior of the serializer to also encode images that were previously encoded as WebP, to ensure that they become cacheable. BUG=597807, 600719, 603353 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/a2796c212636511499f47597e76865d7577cd1c8 Cr-Commit-Position: refs/heads/master@{#388013}

Patch Set 1 #

Patch Set 2 : Some small changes to make things more better. #

Patch Set 3 : Now the cache fully works. #

Patch Set 4 : git merge origin/master #

Patch Set 5 : Refactored to new BlobCache interface #

Patch Set 6 : Rename to InfiniteBlobCache #

Patch Set 7 : self-review #

Patch Set 8 : Undo previous merge-issue and change from |sha1| to |id| in proto field. #

Patch Set 9 : Update test name to new API #

Total comments: 53

Patch Set 10 : Addressed all comments. #

Total comments: 26

Patch Set 11 : Addressed comments from kmarshall, except swap #

Total comments: 33

Patch Set 12 : Addressed all comments #

Patch Set 13 : Changed to use BlobId and BlobData #

Total comments: 7

Patch Set 14 : Changed BlobId from 'const std::string' to 'std::string' #

Total comments: 16

Patch Set 15 : Addressed last comments in review #

Patch Set 16 : Renamed blob_cache sha1_util to id_util #

Patch Set 17 : git merge origin/master for good measure #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+409 lines, -23 lines) Patch
M blimp/client/feature/compositor/decoding_image_generator.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +14 lines, -9 lines 0 comments Download
M blimp/common/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +6 lines, -0 lines 0 comments Download
A blimp/common/blob_cache/blob_cache.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +38 lines, -0 lines 0 comments Download
A blimp/common/blob_cache/id_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +27 lines, -0 lines 0 comments Download
A blimp/common/blob_cache/id_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +27 lines, -0 lines 1 comment Download
A blimp/common/blob_cache/in_memory_blob_cache.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +38 lines, -0 lines 0 comments Download
A blimp/common/blob_cache/in_memory_blob_cache.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +41 lines, -0 lines 0 comments Download
A blimp/common/blob_cache/in_memory_blob_cache_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +68 lines, -0 lines 0 comments Download
M blimp/common/compositor/webp_decoder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +71 lines, -4 lines 0 comments Download
M blimp/common/proto/BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A blimp/common/proto/blob_cache.proto View 1 2 3 4 5 6 7 8 9 10 1 chunk +21 lines, -0 lines 0 comments Download
M blimp/engine/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M blimp/engine/renderer/engine_image_serialization_processor.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 7 chunks +55 lines, -10 lines 0 comments Download

Messages

Total messages: 48 (19 generated)
nyquist
kmarshall, vmpstr: PTAL
4 years, 8 months ago (2016-04-13 21:18:23 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1867653002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1867653002/160001
4 years, 8 months ago (2016-04-13 21:18:26 UTC) #6
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-13 22:05:25 UTC) #9
Kevin M
https://codereview.chromium.org/1867653002/diff/160001/blimp/client/feature/compositor/decoding_image_generator.cc File blimp/client/feature/compositor/decoding_image_generator.cc (right): https://codereview.chromium.org/1867653002/diff/160001/blimp/client/feature/compositor/decoding_image_generator.cc#newcode18 blimp/client/feature/compositor/decoding_image_generator.cc:18: // Check if this is a cache identifier instead ...
4 years, 8 months ago (2016-04-13 23:29:53 UTC) #10
vmpstr
https://codereview.chromium.org/1867653002/diff/160001/blimp/common/blob_cache/blob_cache.h File blimp/common/blob_cache/blob_cache.h (right): https://codereview.chromium.org/1867653002/diff/160001/blimp/common/blob_cache/blob_cache.h#newcode17 blimp/common/blob_cache/blob_cache.h:17: typedef base::RefCountedData<std::vector<uint8_t>> RefCountedVector; I prefer "using RefCountedVector = base::RefCountedData<std::vector<uint8_t>>;" ...
4 years, 8 months ago (2016-04-13 23:48:02 UTC) #11
nyquist
kmarshall, vmpstr: PTAL https://codereview.chromium.org/1867653002/diff/160001/blimp/client/feature/compositor/decoding_image_generator.cc File blimp/client/feature/compositor/decoding_image_generator.cc (right): https://codereview.chromium.org/1867653002/diff/160001/blimp/client/feature/compositor/decoding_image_generator.cc#newcode18 blimp/client/feature/compositor/decoding_image_generator.cc:18: // Check if this is a ...
4 years, 8 months ago (2016-04-14 19:33:24 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1867653002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1867653002/180001
4 years, 8 months ago (2016-04-14 19:36:10 UTC) #16
Kevin M
https://codereview.chromium.org/1867653002/diff/180001/blimp/client/feature/compositor/decoding_image_generator.cc File blimp/client/feature/compositor/decoding_image_generator.cc (right): https://codereview.chromium.org/1867653002/diff/180001/blimp/client/feature/compositor/decoding_image_generator.cc#newcode18 blimp/client/feature/compositor/decoding_image_generator.cc:18: std::unique_ptr<BlobCacheImage> deserialized(new BlobCacheImage); "parsed_metadata"? https://codereview.chromium.org/1867653002/diff/180001/blimp/client/feature/compositor/decoding_image_generator.cc#newcode28 blimp/client/feature/compositor/decoding_image_generator.cc:28: SkImageInfo::MakeN32Premul(deserialized->width(), deserialized->height()); Inline ...
4 years, 8 months ago (2016-04-14 20:08:30 UTC) #17
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-14 20:30:43 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1867653002/190001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1867653002/190001
4 years, 8 months ago (2016-04-15 01:26:30 UTC) #21
nyquist
kmarshall: PTAL https://codereview.chromium.org/1867653002/diff/180001/blimp/client/feature/compositor/decoding_image_generator.cc File blimp/client/feature/compositor/decoding_image_generator.cc (right): https://codereview.chromium.org/1867653002/diff/180001/blimp/client/feature/compositor/decoding_image_generator.cc#newcode18 blimp/client/feature/compositor/decoding_image_generator.cc:18: std::unique_ptr<BlobCacheImage> deserialized(new BlobCacheImage); On 2016/04/14 20:08:30, Kevin ...
4 years, 8 months ago (2016-04-15 01:27:13 UTC) #23
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-15 02:17:10 UTC) #25
Kevin M
https://codereview.chromium.org/1867653002/diff/190001/blimp/common/blob_cache/in_memory_blob_cache.h File blimp/common/blob_cache/in_memory_blob_cache.h (right): https://codereview.chromium.org/1867653002/diff/190001/blimp/common/blob_cache/in_memory_blob_cache.h#newcode32 blimp/common/blob_cache/in_memory_blob_cache.h:32: typedef std::map<std::string, scoped_refptr<RefCountedVector>> Cache; The typedef is kind of ...
4 years, 8 months ago (2016-04-15 17:28:52 UTC) #26
vmpstr
https://codereview.chromium.org/1867653002/diff/190001/blimp/client/feature/compositor/decoding_image_generator.cc File blimp/client/feature/compositor/decoding_image_generator.cc (right): https://codereview.chromium.org/1867653002/diff/190001/blimp/client/feature/compositor/decoding_image_generator.cc#newcode18 blimp/client/feature/compositor/decoding_image_generator.cc:18: std::unique_ptr<BlobCacheImageMetadata> parsed_metadata( Since this seems to be only used ...
4 years, 8 months ago (2016-04-15 18:18:55 UTC) #27
nyquist
kmarshall, vmpstr: PTAL https://codereview.chromium.org/1867653002/diff/190001/blimp/client/feature/compositor/decoding_image_generator.cc File blimp/client/feature/compositor/decoding_image_generator.cc (right): https://codereview.chromium.org/1867653002/diff/190001/blimp/client/feature/compositor/decoding_image_generator.cc#newcode18 blimp/client/feature/compositor/decoding_image_generator.cc:18: std::unique_ptr<BlobCacheImageMetadata> parsed_metadata( On 2016/04/15 18:18:54, vmpstr ...
4 years, 8 months ago (2016-04-16 00:25:30 UTC) #28
vmpstr
https://codereview.chromium.org/1867653002/diff/230001/blimp/common/blob_cache/blob_cache.h File blimp/common/blob_cache/blob_cache.h (right): https://codereview.chromium.org/1867653002/diff/230001/blimp/common/blob_cache/blob_cache.h#newcode25 blimp/common/blob_cache/blob_cache.h:25: virtual bool Contains(BlobId& id) const = 0; On 2016/04/16 ...
4 years, 8 months ago (2016-04-16 00:52:48 UTC) #29
vmpstr
https://codereview.chromium.org/1867653002/diff/230001/blimp/common/blob_cache/blob_cache.h File blimp/common/blob_cache/blob_cache.h (right): https://codereview.chromium.org/1867653002/diff/230001/blimp/common/blob_cache/blob_cache.h#newcode25 blimp/common/blob_cache/blob_cache.h:25: virtual bool Contains(BlobId& id) const = 0; On 2016/04/16 ...
4 years, 8 months ago (2016-04-16 00:55:08 UTC) #30
nyquist
vmpstr: PTAL https://codereview.chromium.org/1867653002/diff/230001/blimp/common/blob_cache/blob_cache.h File blimp/common/blob_cache/blob_cache.h (right): https://codereview.chromium.org/1867653002/diff/230001/blimp/common/blob_cache/blob_cache.h#newcode25 blimp/common/blob_cache/blob_cache.h:25: virtual bool Contains(BlobId& id) const = 0; ...
4 years, 8 months ago (2016-04-16 01:10:50 UTC) #32
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1867653002/250001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1867653002/250001
4 years, 8 months ago (2016-04-16 01:11:12 UTC) #33
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-16 01:56:13 UTC) #35
Kevin M
lgtm Lookin' spiffy! I wrote some feedback to your questions to me from the previous ...
4 years, 8 months ago (2016-04-18 18:13:14 UTC) #36
vmpstr
lgtm with nits https://codereview.chromium.org/1867653002/diff/250001/blimp/common/blob_cache/in_memory_blob_cache.cc File blimp/common/blob_cache/in_memory_blob_cache.cc (right): https://codereview.chromium.org/1867653002/diff/250001/blimp/common/blob_cache/in_memory_blob_cache.cc#newcode20 blimp/common/blob_cache/in_memory_blob_cache.cc:20: // In cases where the engine ...
4 years, 8 months ago (2016-04-18 19:38:12 UTC) #37
nyquist
all done! https://codereview.chromium.org/1867653002/diff/250001/blimp/common/blob_cache/in_memory_blob_cache.cc File blimp/common/blob_cache/in_memory_blob_cache.cc (right): https://codereview.chromium.org/1867653002/diff/250001/blimp/common/blob_cache/in_memory_blob_cache.cc#newcode20 blimp/common/blob_cache/in_memory_blob_cache.cc:20: // In cases where the engine has ...
4 years, 8 months ago (2016-04-18 20:12:03 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1867653002/310001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1867653002/310001
4 years, 8 months ago (2016-04-18 20:12:46 UTC) #41
commit-bot: I haz the power
Committed patchset #17 (id:310001)
4 years, 8 months ago (2016-04-18 20:58:26 UTC) #42
commit-bot: I haz the power
Patchset 17 (id:??) landed as https://crrev.com/a2796c212636511499f47597e76865d7577cd1c8 Cr-Commit-Position: refs/heads/master@{#388013}
4 years, 8 months ago (2016-04-18 21:00:46 UTC) #44
davidben
https://codereview.chromium.org/1867653002/diff/310001/blimp/common/blob_cache/id_util.cc File blimp/common/blob_cache/id_util.cc (right): https://codereview.chromium.org/1867653002/diff/310001/blimp/common/blob_cache/id_util.cc#newcode16 blimp/common/blob_cache/id_util.cc:16: base::SHA1HashBytes(static_cast<const unsigned char*>(data), data_size, Drive-by comment: why is this ...
4 years, 8 months ago (2016-04-22 16:39:49 UTC) #46
nyquist
On 2016/04/22 16:39:49, davidben wrote: > https://codereview.chromium.org/1867653002/diff/310001/blimp/common/blob_cache/id_util.cc > File blimp/common/blob_cache/id_util.cc (right): > > https://codereview.chromium.org/1867653002/diff/310001/blimp/common/blob_cache/id_util.cc#newcode16 > ...
4 years, 8 months ago (2016-04-22 19:27:12 UTC) #47
davidben
4 years, 8 months ago (2016-04-22 19:33:22 UTC) #48
Message was sent while issue was closed.
On 2016/04/22 19:27:12, nyquist wrote:
> On 2016/04/22 16:39:49, davidben wrote:
> >
>
https://codereview.chromium.org/1867653002/diff/310001/blimp/common/blob_cach...
> > File blimp/common/blob_cache/id_util.cc (right):
> > 
> >
>
https://codereview.chromium.org/1867653002/diff/310001/blimp/common/blob_cach...
> > blimp/common/blob_cache/id_util.cc:16: base::SHA1HashBytes(static_cast<const
> > unsigned char*>(data), data_size,
> > Drive-by comment: why is this using SHA-1 and not SHA-2? People have been
> > managing to find attacks against SHA-1 and since I assume you don't have any
> > legacy constraints, using SHA-1 for new things is rather poor.
> 
> Do we have any performance stats for SHA-1 vs SHA-2 regarding how long time
they
> take to calculate?

If you need the security properties, you do not use SHA-1, period. But here are
numbers from BoringSSL on my machine:

$ ./build-release/tool/bssl speed SHA-1
Did 5067000 SHA-1 (16 bytes) operations in 1000012us (5066939.2 ops/sec): 81.1
MB/s
Did 1544000 SHA-1 (256 bytes) operations in 1000107us (1543834.8 ops/sec): 395.2
MB/s
Did 70000 SHA-1 (8192 bytes) operations in 1010120us (69298.7 ops/sec): 567.7
MB/s
$ ./build-release/tool/bssl speed SHA-256
Did 3215000 SHA-256 (16 bytes) operations in 1000097us (3214688.2 ops/sec): 51.4
MB/s
Did 739000 SHA-256 (256 bytes) operations in 1001091us (738194.6 ops/sec): 189.0
MB/s
Did 37000 SHA-256 (8192 bytes) operations in 1020697us (36249.7 ops/sec): 297.0
MB/s

That ought to be fast enough I think. Note that you aren't even getting the
above numbers for SHA-1. You're using //base's copy of SHA-1 which isn't using
BoringSSL's optimized implementation. So in reality you will probably get a
performance win.

Powered by Google App Engine
This is Rietveld 408576698