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

Side by Side Diff: test/unittests/heap/gc-idle-time-handler-unittest.cc

Issue 1034403002: Allow more scavenges in idle notification by increasing the new space limit distance. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/heap/gc-idle-time-handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits> 5 #include <limits>
6 6
7 #include "src/heap/gc-idle-time-handler.h" 7 #include "src/heap/gc-idle-time-handler.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 idle_time_in_ms, heap_state.new_space_capacity, 128 idle_time_in_ms, heap_state.new_space_capacity,
129 heap_state.used_new_space_size, heap_state.scavenge_speed_in_bytes_per_ms, 129 heap_state.used_new_space_size, heap_state.scavenge_speed_in_bytes_per_ms,
130 heap_state.new_space_allocation_throughput_in_bytes_per_ms)); 130 heap_state.new_space_allocation_throughput_in_bytes_per_ms));
131 } 131 }
132 132
133 133
134 TEST_F(GCIdleTimeHandlerTest, DoScavengeUnknownScavengeSpeed) { 134 TEST_F(GCIdleTimeHandlerTest, DoScavengeUnknownScavengeSpeed) {
135 GCIdleTimeHandler::HeapState heap_state = DefaultHeapState(); 135 GCIdleTimeHandler::HeapState heap_state = DefaultHeapState();
136 heap_state.used_new_space_size = kNewSpaceCapacity; 136 heap_state.used_new_space_size = kNewSpaceCapacity;
137 heap_state.scavenge_speed_in_bytes_per_ms = 0; 137 heap_state.scavenge_speed_in_bytes_per_ms = 0;
138 int idle_time_in_ms = 16; 138 int idle_time_in_ms = 8;
139 EXPECT_FALSE(GCIdleTimeHandler::ShouldDoScavenge( 139 EXPECT_FALSE(GCIdleTimeHandler::ShouldDoScavenge(
140 idle_time_in_ms, heap_state.new_space_capacity, 140 idle_time_in_ms, heap_state.new_space_capacity,
141 heap_state.used_new_space_size, heap_state.scavenge_speed_in_bytes_per_ms, 141 heap_state.used_new_space_size, heap_state.scavenge_speed_in_bytes_per_ms,
142 heap_state.new_space_allocation_throughput_in_bytes_per_ms)); 142 heap_state.new_space_allocation_throughput_in_bytes_per_ms));
143 } 143 }
144 144
145 145
146 TEST_F(GCIdleTimeHandlerTest, DoScavengeLowScavengeSpeed) { 146 TEST_F(GCIdleTimeHandlerTest, DoScavengeLowScavengeSpeed) {
147 GCIdleTimeHandler::HeapState heap_state = DefaultHeapState(); 147 GCIdleTimeHandler::HeapState heap_state = DefaultHeapState();
148 heap_state.used_new_space_size = kNewSpaceCapacity; 148 heap_state.used_new_space_size = kNewSpaceCapacity;
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 // Emulate mutator work. 435 // Emulate mutator work.
436 for (int i = 0; i < GCIdleTimeHandler::kIdleScavengeThreshold; i++) { 436 for (int i = 0; i < GCIdleTimeHandler::kIdleScavengeThreshold; i++) {
437 handler()->NotifyScavenge(); 437 handler()->NotifyScavenge();
438 } 438 }
439 action = handler()->Compute(0, heap_state); 439 action = handler()->Compute(0, heap_state);
440 EXPECT_EQ(DO_NOTHING, action.type); 440 EXPECT_EQ(DO_NOTHING, action.type);
441 } 441 }
442 442
443 } // namespace internal 443 } // namespace internal
444 } // namespace v8 444 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/gc-idle-time-handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698