Race to halt means completing work quickly so a machine can return sooner to an idle or low-power state. Shorter high-power operation can reduce total energy use, even when instantaneous power briefly rises. section 8.4.5
Invoice batches
A monthly invoice job processes thousands of users while the server handles 200 invoices at once. Partition customer IDs into batches, generate each batch, avoid batches that are unnecessarily small, and use concurrency when the available CPU cores can support it. section 8.4.5
Apply the technique by:
- Using available CPU capacity efficiently instead of stretching work across a longer period. section 8.4.5
- Balancing batch size and concurrency against workload limits and system resilience. section 8.4.5
List<Long> customerIds = loadCustomerIds();
List<List<Long>> batches = Lists #1
.partition(customerIds, 200); #1
for (List<Long> batch : batches) {
generateInvoices(batch);
}
A Java listing demonstrates partitioning customer IDs into fixed-size batches before invoice generation. section 8.4.5
