diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-10 22:34:32 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-13 13:52:10 +0000 |
| commit | 71f55957f074818d782971a0b678a77d330597d3 (patch) | |
| tree | e62f4f2a3c3469df20d25ecddbacc3c0bb357f59 /bitbake/lib | |
| parent | a7bbb105d33c1c85cee340ae6266609532024beb (diff) | |
| download | poky-71f55957f074818d782971a0b678a77d330597d3.tar.gz | |
bitbake: runqueue: Optimise taskname lookups in next_buildable_task
A quick profile of bitbake world showed 147 million calls to taskname_from_tid().
The next_buildable_task function is performance senstive so move the call
inside the if block to reduce the number of calls and speed the code up.
(Bitbake rev: 8b332c16a7b6b85c5cbe1919dd8cae45fda6adf9)
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, 3 insertions, 3 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index c8392346a8..95cab5132f 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
| @@ -270,11 +270,11 @@ class RunQueueScheduler(object): | |||
| 270 | best = None | 270 | best = None |
| 271 | bestprio = None | 271 | bestprio = None |
| 272 | for tid in buildable: | 272 | for tid in buildable: |
| 273 | taskname = taskname_from_tid(tid) | ||
| 274 | if taskname in skip_buildable and skip_buildable[taskname] >= int(self.skip_maxthread[taskname]): | ||
| 275 | continue | ||
| 276 | prio = self.rev_prio_map[tid] | 273 | prio = self.rev_prio_map[tid] |
| 277 | if bestprio is None or bestprio > prio: | 274 | if bestprio is None or bestprio > prio: |
| 275 | taskname = taskname_from_tid(tid) | ||
| 276 | if taskname in skip_buildable and skip_buildable[taskname] >= int(self.skip_maxthread[taskname]): | ||
| 277 | continue | ||
| 278 | stamp = self.stamps[tid] | 278 | stamp = self.stamps[tid] |
| 279 | if stamp in self.rq.build_stamps.values(): | 279 | if stamp in self.rq.build_stamps.values(): |
| 280 | continue | 280 | continue |
