Author: [email protected]
Date: Mon Jun 29 00:19:17 2009
New Revision: 2286

Modified:
    branches/bleeding_edge/src/objects.cc

Log:
Changed  HashTable::EnsureCapacity to gurantee at least 50% of the entries  
are free (up from 25%).
This reduces the mount of probing in large hash tables.

Review URL: http://codereview.chromium.org/150017

Modified: branches/bleeding_edge/src/objects.cc
==============================================================================
--- branches/bleeding_edge/src/objects.cc       (original)
+++ branches/bleeding_edge/src/objects.cc       Mon Jun 29 00:19:17 2009
@@ -6357,8 +6357,8 @@
      int n, HashTableKey* key) {
    int capacity = Capacity();
    int nof = NumberOfElements() + n;
-  // Make sure 25% is free
-  if (nof + (nof >> 2) <= capacity) return this;
+  // Make sure 50% is free
+  if (nof + (nof >> 1) <= capacity) return this;

    Object* obj = Allocate(nof * 2);
    if (obj->IsFailure()) return obj;

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to