diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-29 22:23:52 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-29 22:23:52 +0000 |
commit | 032bfc439fbac7f08f562d6914b960008ce64bd4 (patch) | |
tree | f0011d01ec93997c514ffa64812bf4747d973dad /base/pickle.h | |
parent | 594401ea5766f50d8bb9d3e5a2acf3df271a3ece (diff) | |
download | chromium_src-032bfc439fbac7f08f562d6914b960008ce64bd4.zip chromium_src-032bfc439fbac7f08f562d6914b960008ce64bd4.tar.gz chromium_src-032bfc439fbac7f08f562d6914b960008ce64bd4.tar.bz2 |
IPC pickling optimization for render passes.
Call Pickle::Reserve() for the size of the data in the shared quad
state and quad lists. This prevents the WriteFoo() invocations for
all of the quad/shared quad states from causing memory re-allocations
and moves.
This is based on https://codereview.chromium.org/34413002/ from piman@.
This is also based after https://codereview.chromium.org/30593005/ and
perf numbers (both before and after) include that CL also.
content_perftest results on linux chromeos release official build:
BEFORE
*RESULT mean_frame_serialization_time: DelegatedFrame_ManyQuads_1_4000= 50 us
*RESULT mean_frame_serialization_time: DelegatedFrame_ManyQuads_1_100000= 1888 us
*RESULT mean_frame_serialization_time: DelegatedFrame_ManyQuads_4000_4000= 728 us
*RESULT mean_frame_serialization_time: DelegatedFrame_ManyQuads_100000_100000= 23771 us
*RESULT mean_frame_serialization_time: DelegatedFrame_ManyRenderPasses_10000_100= 24118 us
AFTER
*RESULT mean_frame_serialization_time: DelegatedFrame_ManyQuads_1_4000= 48 us
*RESULT mean_frame_serialization_time: DelegatedFrame_ManyQuads_1_100000= 1626 us
*RESULT mean_frame_serialization_time: DelegatedFrame_ManyQuads_4000_4000= 460 us
*RESULT mean_frame_serialization_time: DelegatedFrame_ManyQuads_100000_100000= 14771 us
*RESULT mean_frame_serialization_time: DelegatedFrame_ManyRenderPasses_10000_100= 15626 us
This gives a further ~1.5x improvement in serialization time for shared quad
states and render passes.
R=jar@chromium.org, piman@chromium.org, tsepez@chromium.org, piman
BUG=307480
Review URL: https://codereview.chromium.org/35893002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231656 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/pickle.h')
-rw-r--r-- | base/pickle.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/base/pickle.h b/base/pickle.h index 29e9b22..c90dbf4 100644 --- a/base/pickle.h +++ b/base/pickle.h @@ -273,6 +273,11 @@ class BASE_EXPORT Pickle { // not been changed. void TrimWriteData(int length); + // Reserves space for upcoming writes when multiple writes will be made and + // their sizes are computed in advance. It can be significantly faster to call + // Reserve() before calling WriteFoo() multiple times. + void Reserve(size_t additional_capacity); + // Payload follows after allocation of Header (header size is customizable). struct Header { uint32 payload_size; // Specifies the size of the payload. |