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

Unified Diff: src/compiler/value-numbering-reducer.cc

Issue 2474873003: [turbofan] Tune the ValueNumberingReducer's growth rate (Closed)
Patch Set: Created 4 years, 1 month 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 | « src/compiler/value-numbering-reducer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/value-numbering-reducer.cc
diff --git a/src/compiler/value-numbering-reducer.cc b/src/compiler/value-numbering-reducer.cc
index 4769cb0c8b02fc436f94e1cd241c633fab940b09..b9161df6a29c4f73270cb54096f659016e0630bd 100644
--- a/src/compiler/value-numbering-reducer.cc
+++ b/src/compiler/value-numbering-reducer.cc
@@ -69,7 +69,7 @@ Reduction ValueNumberingReducer::Reduce(Node* node) {
}
DCHECK(size_ < capacity_);
- DCHECK(size_ * kCapacityToSizeRatio < capacity_);
+ DCHECK(size_ + size_ / 4 < capacity_);
const size_t mask = capacity_ - 1;
size_t dead = capacity_;
@@ -85,10 +85,10 @@ Reduction ValueNumberingReducer::Reduce(Node* node) {
entries_[i] = node;
size_++;
- // Resize to keep load factor below 1/kCapacityToSizeRatio.
- if (size_ * kCapacityToSizeRatio >= capacity_) Grow();
+ // Resize to keep load factor below 80%
+ if (size_ + size_ / 4 >= capacity_) Grow();
}
- DCHECK(size_ * kCapacityToSizeRatio < capacity_);
+ DCHECK(size_ + size_ / 4 < capacity_);
return NoChange();
}
@@ -152,11 +152,10 @@ Reduction ValueNumberingReducer::Reduce(Node* node) {
void ValueNumberingReducer::Grow() {
- // Allocate a new block of entries kCapacityToSizeRatio times the previous
- // capacity.
+ // Allocate a new block of entries double the previous capacity.
Node** const old_entries = entries_;
size_t const old_capacity = capacity_;
- capacity_ *= kCapacityToSizeRatio;
+ capacity_ *= 2;
entries_ = temp_zone()->NewArray<Node*>(capacity_);
memset(entries_, 0, sizeof(*entries_) * capacity_);
size_ = 0;
« no previous file with comments | « src/compiler/value-numbering-reducer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698