summary refs log tree commit diff
path: root/gnu/services.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-10-12 14:21:54 +0200
committerLudovic Courtès <ludo@gnu.org>2017-10-12 17:51:41 +0200
commitd8e89b1c794141b21ae4a87244d2c181b4a8460c (patch)
treeec998427faac68fea16a04319fcfab5f81149904 /gnu/services.scm
parentabaee53c808fe6df02de2f403dd8904e42d5fede (diff)
downloadguix-d8e89b1c794141b21ae4a87244d2c181b4a8460c.tar.gz
offload: Reduce the number of calls to 'machine-load'.
Previously we would call 'machine-load' once per machine, which was very
costly when there were many machines.  Now we arrange to call it only
once on average (when all the machines have the same 'speed' value).

* guix/scripts/offload.scm (random-seed, shuffle): New procedures.
(choose-build-machine)[machines+slots+loads]: Rename to...
[machines+slots]: ... this.  Remove load from the tuples therein.
[undecorate]: Adjust accordingly.
[machine-less-loaded-or-faster?]: Remove.
[machine-faster?]: New procedure.
Sort MACHINES+SLOTS according to 'machine-faster?'.  Call
'machine-load?' as the last thing.
Diffstat (limited to 'gnu/services.scm')
0 files changed, 0 insertions, 0 deletions