syncer::MetadataBatch should support moving by value |
|||
Issue descriptionProtos are movable nowadays. MetadataBatch::AddMetadata() [1] incurs unnecessary copy. This should be changed to support moving by value or by std::unique_ptr<> [1] https://cs.chromium.org/chromium/src/components/sync/model/metadata_batch.cc?sq=package:chromium&dr=Ss&g=0&l=28
,
Dec 13
The two options proposed here are: 1- Pass-by-value so the caller can std::move(). 2- Pass using std::unique_ptr<>.
,
Dec 13
P3 seems appropriate here but this one is also a very low-hanging fruit, because: a) We don't have many callers to this API (4 calling sites). b) Metadata loading happens during browser's startup and incurring in one copy (and I think today we may incur in two) may mean ~300 KB of RAM for a user with 1000 sync entities in total across all datatypes. Startup is precisely a time when resource optimization is worth. I would personally prefer std::unique_ptr<> which we already do in other similar APIs.
,
Dec 13
sounds reasonable. I wish we could actually measure this. sorry for the noise.
,
Dec 13
,
Jan 17
(5 days ago)
|
|||
►
Sign in to add a comment |
|||
Comment 1 by tschumann@google.com
, Dec 13