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

Unified Diff: gpu/command_buffer/common/id_allocator.h

Issue 7077006: Speed up IdAllocator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Clarified description. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/common/id_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/id_allocator.h
===================================================================
--- gpu/command_buffer/common/id_allocator.h (revision 86796)
+++ gpu/command_buffer/common/id_allocator.h (working copy)
@@ -44,9 +44,14 @@
// TODO(gman): This would work much better with ranges or a hash table.
typedef std::set<ResourceId> ResourceIdSet;
greggman 2011/05/26 16:25:29 If were doing this for speed, how about changing t
- ResourceId FindFirstFree() const;
+ // The highest ID on the used list.
+ ResourceId LastUsedId() const;
+ // Lowest ID that isn't on the used list. This is slow, use as a last resort.
+ ResourceId FindFirstUnusedId() const;
+
ResourceIdSet used_ids_;
+ ResourceIdSet free_ids_;
DISALLOW_COPY_AND_ASSIGN(IdAllocator);
};
« no previous file with comments | « no previous file | gpu/command_buffer/common/id_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698