summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Bell <peterbell10@live.co.uk>2021-08-27 11:12:45 (GMT)
committerPeter Bell <peterbell10@live.co.uk>2021-08-27 18:42:31 (GMT)
commitfe80637327997d0a97e1eee45e3d0929edc75bbd (patch)
tree24f42cf6bc9db1a62767b5e68b81474a9c156175 /src
parent5b8d19b24b00973976990303524f47750e3e1dc4 (diff)
downloadNinja-fe80637327997d0a97e1eee45e3d0929edc75bbd.zip
Ninja-fe80637327997d0a97e1eee45e3d0929edc75bbd.tar.gz
Ninja-fe80637327997d0a97e1eee45e3d0929edc75bbd.tar.bz2
Address review comments
Diffstat (limited to 'src')
-rw-r--r--src/build.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/build.cc b/src/build.cc
index 08b0cc6..99e6efa 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -440,7 +440,7 @@ namespace {
template <typename T>
struct SeenBefore {
- std::set<const T*> *seen_;
+ std::set<const T*>* seen_;
SeenBefore(std::set<const T*>* seen) : seen_(seen) {}
@@ -473,13 +473,9 @@ void Plan::ComputeCriticalTime(BuildLog* build_log) {
// Critical path scheduling.
// 0. Assign costs to all edges, using:
// a) The time the edge needed last time, if available.
- // b) The average time this edge type needed, if this edge hasn't run before.
- // (not implemented .log entries is not grouped by rule type, and even
- // similar rule type may not have same name , for example two compile rule
- // with different compile flags)
- // c) A fixed cost if this type of edge hasn't run before (0 for phony target,
- // 1 for others)
- //
+ // b) A fixed cost if this type of edge hasn't run before (0 for
+ // phony target, 1 for others)
+ // TODO: Find a better heuristic for edges without log entries
for (std::map<Edge*, Want>::iterator it = want_.begin(), end = want_.end();
it != end; ++it) {
Edge* edge = it->first;
@@ -490,6 +486,7 @@ void Plan::ComputeCriticalTime(BuildLog* build_log) {
build_log->LookupByOutput(edge->outputs_[0]->path());
if (!entry) {
edge->run_time_ms_ = 1;
+ total_time += 1;
continue;
}
const int64_t duration = entry->end_time - entry->start_time;