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

Issue 1131913004: More compact representation of the GL Query cache (Closed)

Created:
5 years, 7 months ago by Daniel Bratell
Modified:
5 years, 7 months ago
Reviewers:
reveman, jbauman
CC:
chromium-reviews, piman+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

More compact representation of the GL Query cache. The only thing we need to know per QuerySync block is its index in the block sequence. Everything else can be calculated from that if we just store a few numbers in the Bucket objects. Total memory reduction is 92%. This is alt #2 in bug 485536. BUG=485536 Committed: https://crrev.com/e49ed7adac7c2100b340f8963fcafa48544dccdf Cr-Commit-Position: refs/heads/master@{#330334}

Patch Set 1 #

Patch Set 2 : Shrink even more. #

Patch Set 3 : Minimize patch size #

Patch Set 4 : Smaller patch still. #

Total comments: 18

Patch Set 5 : Post review. #

Patch Set 6 : Removed the |used| counter #

Patch Set 7 : And unittest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -31 lines) Patch
M gpu/command_buffer/client/query_tracker.h View 1 2 3 4 5 3 chunks +6 lines, -6 lines 0 comments Download
M gpu/command_buffer/client/query_tracker.cc View 1 2 3 4 5 4 chunks +37 lines, -22 lines 0 comments Download
M gpu/command_buffer/client/query_tracker_unittest.cc View 1 2 3 4 5 6 4 chunks +7 lines, -3 lines 0 comments Download

Messages

Total messages: 21 (5 generated)
Daniel Bratell
5 years, 7 months ago (2015-05-11 09:58:22 UTC) #2
Daniel Bratell
Adding jbauman as reviewer too since he recommended this approach in the bug.
5 years, 7 months ago (2015-05-11 14:13:54 UTC) #4
reveman
https://codereview.chromium.org/1131913004/diff/60001/gpu/command_buffer/client/query_tracker.cc File gpu/command_buffer/client/query_tracker.cc (right): https://codereview.chromium.org/1131913004/diff/60001/gpu/command_buffer/client/query_tracker.cc#newcode30 gpu/command_buffer/client/query_tracker.cc:30: QuerySyncManager::Bucket::~Bucket() = default; is "= default;" allowed/recommended now? https://codereview.chromium.org/1131913004/diff/60001/gpu/command_buffer/client/query_tracker.cc#newcode49 ...
5 years, 7 months ago (2015-05-11 17:13:08 UTC) #5
jbauman
https://codereview.chromium.org/1131913004/diff/60001/gpu/command_buffer/client/query_tracker.h File gpu/command_buffer/client/query_tracker.h (right): https://codereview.chromium.org/1131913004/diff/60001/gpu/command_buffer/client/query_tracker.h#newcode40 gpu/command_buffer/client/query_tracker.h:40: std::vector<unsigned short> free_queries; Could you add a COMPILE_ASSERT that ...
5 years, 7 months ago (2015-05-11 19:12:53 UTC) #6
Daniel Bratell
https://codereview.chromium.org/1131913004/diff/60001/gpu/command_buffer/client/query_tracker.cc File gpu/command_buffer/client/query_tracker.cc (right): https://codereview.chromium.org/1131913004/diff/60001/gpu/command_buffer/client/query_tracker.cc#newcode30 gpu/command_buffer/client/query_tracker.cc:30: QuerySyncManager::Bucket::~Bucket() = default; On 2015/05/11 17:13:07, reveman wrote: > ...
5 years, 7 months ago (2015-05-12 16:16:41 UTC) #7
reveman
https://codereview.chromium.org/1131913004/diff/60001/gpu/command_buffer/client/query_tracker.h File gpu/command_buffer/client/query_tracker.h (right): https://codereview.chromium.org/1131913004/diff/60001/gpu/command_buffer/client/query_tracker.h#newcode37 gpu/command_buffer/client/query_tracker.h:37: unsigned used_query_count; On 2015/05/12 16:16:40, Daniel Bratell wrote: > ...
5 years, 7 months ago (2015-05-12 16:45:05 UTC) #8
Daniel Bratell
On 2015/05/12 16:45:05, reveman wrote: > https://codereview.chromium.org/1131913004/diff/60001/gpu/command_buffer/client/query_tracker.h > File gpu/command_buffer/client/query_tracker.h (right): > > https://codereview.chromium.org/1131913004/diff/60001/gpu/command_buffer/client/query_tracker.h#newcode37 > ...
5 years, 7 months ago (2015-05-13 08:35:26 UTC) #9
reveman
lgtm
5 years, 7 months ago (2015-05-13 13:00:28 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1131913004/120001
5 years, 7 months ago (2015-05-13 14:22:34 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/63321)
5 years, 7 months ago (2015-05-13 14:29:18 UTC) #14
Daniel Bratell
jbauman, we need your reviews as well! Can you please take a look?
5 years, 7 months ago (2015-05-13 14:45:49 UTC) #15
jbauman
lgtm
5 years, 7 months ago (2015-05-13 18:43:53 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1131913004/120001
5 years, 7 months ago (2015-05-18 07:11:21 UTC) #18
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 7 months ago (2015-05-18 08:15:20 UTC) #19
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/e49ed7adac7c2100b340f8963fcafa48544dccdf Cr-Commit-Position: refs/heads/master@{#330334}
5 years, 7 months ago (2015-05-18 11:33:55 UTC) #20
Daniel Bratell
5 years, 7 months ago (2015-05-18 12:18:33 UTC) #21
Message was sent while issue was closed.
> > Btw, have you considered using std::bitset<kSyncsPerBucket> where bit k
> > represents the query at index k? That would very compact and I bet it would
be
> > plenty fast to just search it for a free query.
> 
> Hey, that is the Opera way of thinking! (People underestimate the speed of
> linear scan through memory so for guaranteed not-large N, arrays will be
> smaller, faster and need less machine code than more complex data structures -
> that is something we take advantage of in Presto but not something that is
> generally accepted in Chromium because of the risks and maintenance once N
might
> be increasing beyond "small"). I have considered it but right now I rather
land
> this. I can prepare a followup patch once this has landed and we can see if we
> think it's worth it.

reveman: Uploaded (but not yet published) std::bitset solution to
https://codereview.chromium.org/1129253006/ 
It will use an estimated 6-10 KB less memory and has the same performance for
normal use cases as far as I can judge. A bit tricker and more complex though.

Powered by Google App Engine
This is Rietveld 408576698