Benjamin Schubert pushed to branch bschubert/rework-sort at BuildStream / buildstream
Commits:
-
df290652
by Benjamin Schubert at 2019-02-04T18:39:32Z
1 changed file:
Changes:
... | ... | @@ -445,6 +445,8 @@ class Loader(): |
445 | 445 |
meta_element = element._loader._collect_element(element)
|
446 | 446 |
element.visit(meta_element)
|
447 | 447 |
|
448 |
+ pq = deque()
|
|
449 |
+ |
|
448 | 450 |
for dep in sorted(element.dependencies, key=cmp_to_key(compare_unprocessed), reverse=True):
|
449 | 451 |
if dep.dep_type != Symbol.RUNTIME:
|
450 | 452 |
dep.element.on_visit(meta_element.build_dependencies.append)
|
... | ... | @@ -455,12 +457,14 @@ class Loader(): |
455 | 457 |
if dep.element.tried_visit:
|
456 | 458 |
# This element has already been requested, we should treat
|
457 | 459 |
# it as soon as possible
|
458 |
- elements_to_load.append(dep.element)
|
|
460 |
+ pq.appendleft(dep.element)
|
|
459 | 461 |
else:
|
460 | 462 |
elements_to_load.appendleft(dep.element)
|
461 | 463 |
|
462 | 464 |
dep.element.in_pipeline = True
|
463 | 465 |
|
466 |
+ elements_to_load.extend(pq)
|
|
467 |
+ |
|
464 | 468 |
for element in self._meta_elements.values():
|
465 | 469 |
element.build_dependencies.sort(key=attrgetter("index"), reverse=True)
|
466 | 470 |
element.dependencies.sort(key=attrgetter("index"), reverse=True)
|