diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-12-14 18:17:01 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-12-16 23:27:14 +0000 |
commit | e4dc65ad46a1da2df5fc0042e24bbe8ccdd7bd90 (patch) | |
tree | 9cdc34179f331a2b00f9ab8b718f467556a4a2cf /bitbake/lib | |
parent | 884463c8d1518d6bf1884e9526b4a50384290fe7 (diff) | |
download | poky-e4dc65ad46a1da2df5fc0042e24bbe8ccdd7bd90.tar.gz |
bitbake: runqueue: Fix sstate task iteration performance
Creating a new sorted list of sstate tasks each iteration through runqueue is
extremely ineffecient and was compounded by the recent change from a list to set.
Create one sorted list instead of recreating it each time.
(Bitbake rev: de18824996841c3f35f54ff5ad12f94f6dc20d88)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 515e9d4314..2ba4557f9f 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1965,10 +1965,14 @@ class RunQueueExecute: | |||
1965 | self.rq.read_workers() | 1965 | self.rq.read_workers() |
1966 | self.process_possible_migrations() | 1966 | self.process_possible_migrations() |
1967 | 1967 | ||
1968 | if not hasattr(self, "sorted_setscene_tids"): | ||
1969 | # Don't want to sort this set every execution | ||
1970 | self.sorted_setscene_tids = sorted(self.rqdata.runq_setscene_tids) | ||
1971 | |||
1968 | task = None | 1972 | task = None |
1969 | if not self.sqdone and self.can_start_task(): | 1973 | if not self.sqdone and self.can_start_task(): |
1970 | # Find the next setscene to run | 1974 | # Find the next setscene to run |
1971 | for nexttask in sorted(self.rqdata.runq_setscene_tids): | 1975 | for nexttask in self.sorted_setscene_tids: |
1972 | if nexttask in self.sq_buildable and nexttask not in self.sq_running and self.sqdata.stamps[nexttask] not in self.build_stamps.values(): | 1976 | if nexttask in self.sq_buildable and nexttask not in self.sq_running and self.sqdata.stamps[nexttask] not in self.build_stamps.values(): |
1973 | if nexttask not in self.sqdata.unskippable and len(self.sqdata.sq_revdeps[nexttask]) > 0 and self.sqdata.sq_revdeps[nexttask].issubset(self.scenequeue_covered) and self.check_dependencies(nexttask, self.sqdata.sq_revdeps[nexttask]): | 1977 | if nexttask not in self.sqdata.unskippable and len(self.sqdata.sq_revdeps[nexttask]) > 0 and self.sqdata.sq_revdeps[nexttask].issubset(self.scenequeue_covered) and self.check_dependencies(nexttask, self.sqdata.sq_revdeps[nexttask]): |
1974 | if nexttask not in self.rqdata.target_tids: | 1978 | if nexttask not in self.rqdata.target_tids: |