The Factorio Benchmark Website

test-000013 : Are electric networks updated in parallel with each other?

Factorio Version 1.0.0

The TLDR

No, electric networks are not updated in parallel with each other. There is a small but measurable difference in performance between 1 electric network per save and many per save. 1 network offers superior performance.

The Question

In recent Factorio versions, electric networks have been said to gain threading (along with heat pipes). However, some confusion has persisted with regards to what actually is threaded (or not). Therefore, this test aims to measure if separate electric networks are updated in parallel with other electric networks or not. In reading the FFF in which these changes were introduced, it seemed clear to me that electric networks would not be updated in parallel with one another, rather they would update in parallel with the heat pipe update and fluid update only.

To put to rest any confusion, we will measure the performance of multiple parallel electric networks.

The Test

This test consists of 32 identical bot cells that each produce ~23 speed module 3s per minute. Each cell is powered by a bank of roughly 24k solar panels, and the daytime of the surface has been frozen so the panels provide a constant source of power.

Each cell and power network was configured in the following ways:

Since this test is being conducted on a 8C/16T Ryzen 7 3700x, these values should offer a reasonable view into what threading if any is being performed.

Each of the configurations above was saved at the exact same tick as one another, and each map was individially benchmarked for 300 ticks with a total of 10 runs. For each tick of the 300 ticks per map, the fastest tick recorded in the 10 runs will be used as the measurement. This is because each tick slower than the fastest could reasonably be assumed to be caused by outside operating system influence.

An automated benchmarking template was generated for this test using factorio-benchmark-helper

These tests can be automatically reran using ./factorio-benchmark-helper --benchmark test-000013 (Or if compiling from source cargo run --release -- --benchmark test-000013)

The Data

In running this test, there is hardly a difference observed between each of the configurations. Only when we look at the average data does a winner emerge. However even in that case the results are very close, only the 32 network case seems to fall behind significantly compared to the rest.

It seems exceedingly unlikely that any threading is occuring on these networks, and even if any is occuring, the best result was the singular network case.

Closing

There doesn't seem to be any threading of multiple electric networks in a single save. If there is any threading, it doesn't appear to be meaningful.

Since the simplest option is to have one global electric network, this result is nice in terms of build effort required to achive maximum performance.