summaryrefslogtreecommitdiffstats
path: root/base/pickle.h
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-29 22:23:52 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-29 22:23:52 +0000
commit032bfc439fbac7f08f562d6914b960008ce64bd4 (patch)
treef0011d01ec93997c514ffa64812bf4747d973dad /base/pickle.h
parent594401ea5766f50d8bb9d3e5a2acf3df271a3ece (diff)
downloadchromium_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.h5
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.