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

Unified Diff: src/objects.cc

Issue 1375913002: KeyAccumulator: tweaking parameters for benchmarks (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2015-09-08_hasOwnProperty_perf_GetKeys_v2904_1316213008
Patch Set: fixing nit Created 5 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index ca941ce4e21a0c6c0a6b6eb9cc54e8ffd3441054..d89af49762c1feecdfa2b9472e916122caf35c41 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -6792,8 +6792,10 @@ void KeyAccumulator::PrepareForComparisons(int count) {
// hash-table-based checks which have a one-time overhead for
// initializing but O(1) for HasKey checks.
if (!set_.is_null()) return;
- // This limit was obtained through evaluation of a microbench.
- if (length_ * count < 50) return;
+ // These limits were obtained through evaluation of several microbenchmarks.
+ if (length_ * count < 100) return;
+ // Don't use a set for few elements
+ if (length_ < 100 && count < 20) return;
set_ = OrderedHashSet::Allocate(isolate_, length_);
for (int i = 0; i < length_; i++) {
Handle<Object> value(keys_->get(i), isolate_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698