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

Side by Side Diff: src/compiler-dispatcher/compiler-dispatcher-tracer.cc

Issue 2611313002: [complier] Enable parallel eager inner function compilation with compiler dispatcher. (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 "src/compiler-dispatcher/compiler-dispatcher-tracer.h" 5 #include "src/compiler-dispatcher/compiler-dispatcher-tracer.h"
6 6
7 #include "src/isolate.h" 7 #include "src/isolate.h"
8 #include "src/utils.h" 8 #include "src/utils.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 double CompilerDispatcherTracer::EstimateFinalizeCompilingInMs() const { 142 double CompilerDispatcherTracer::EstimateFinalizeCompilingInMs() const {
143 base::LockGuard<base::Mutex> lock(&mutex_); 143 base::LockGuard<base::Mutex> lock(&mutex_);
144 return Average(finalize_compiling_events_); 144 return Average(finalize_compiling_events_);
145 } 145 }
146 146
147 void CompilerDispatcherTracer::DumpStatistics() const { 147 void CompilerDispatcherTracer::DumpStatistics() const {
148 PrintF( 148 PrintF(
149 "CompilerDispatcherTracer: " 149 "CompilerDispatcherTracer: "
150 "prepare_parsing=%.2lfms parsing=%.2lfms/kb finalize_parsing=%.2lfms " 150 "prepare_parsing=%.2lfms parsing=%.2lfms/kb finalize_parsing=%.2lfms "
151 "prepare_compiling=%.2lfms compiling=%.2lfms/kb " 151 "prepare_compiling=%.2lfms compiling=%.2lfms/kb "
152 "finalize_compilig=%.2lfms\n", 152 "finalize_compiling=%.2lfms\n",
153 EstimatePrepareToParseInMs(), EstimateParseInMs(1 * KB), 153 EstimatePrepareToParseInMs(), EstimateParseInMs(1 * KB),
154 EstimateFinalizeParsingInMs(), EstimatePrepareToCompileInMs(), 154 EstimateFinalizeParsingInMs(), EstimatePrepareToCompileInMs(),
155 EstimateCompileInMs(1 * KB), EstimateFinalizeCompilingInMs()); 155 EstimateCompileInMs(1 * KB), EstimateFinalizeCompilingInMs());
156 } 156 }
157 157
158 double CompilerDispatcherTracer::Average( 158 double CompilerDispatcherTracer::Average(
159 const base::RingBuffer<double>& buffer) { 159 const base::RingBuffer<double>& buffer) {
160 if (buffer.Count() == 0) return 0.0; 160 if (buffer.Count() == 0) return 0.0;
161 double sum = buffer.Sum([](double a, double b) { return a + b; }, 0.0); 161 double sum = buffer.Sum([](double a, double b) { return a + b; }, 0.0);
162 return sum / buffer.Count(); 162 return sum / buffer.Count();
163 } 163 }
164 164
165 double CompilerDispatcherTracer::Estimate( 165 double CompilerDispatcherTracer::Estimate(
166 const base::RingBuffer<std::pair<size_t, double>>& buffer, size_t num) { 166 const base::RingBuffer<std::pair<size_t, double>>& buffer, size_t num) {
167 if (buffer.Count() == 0) return kEstimatedRuntimeWithoutData; 167 if (buffer.Count() == 0) return kEstimatedRuntimeWithoutData;
168 std::pair<size_t, double> sum = buffer.Sum( 168 std::pair<size_t, double> sum = buffer.Sum(
169 [](std::pair<size_t, double> a, std::pair<size_t, double> b) { 169 [](std::pair<size_t, double> a, std::pair<size_t, double> b) {
170 return std::make_pair(a.first + b.first, a.second + b.second); 170 return std::make_pair(a.first + b.first, a.second + b.second);
171 }, 171 },
172 std::make_pair(0, 0.0)); 172 std::make_pair(0, 0.0));
173 return num * (sum.second / sum.first); 173 return num * (sum.second / sum.first);
174 } 174 }
175 175
176 } // namespace internal 176 } // namespace internal
177 } // namespace v8 177 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698