sapi/eu4Replay

Performance issues loading saves

Closed this issue · 1 comments

sapi commented

Loading saves is far too slow.

The majority of this issue seems, according to profiling, to come from read_object.

A good first step would thus be to change how parse_object operates, so that it does not need read_object.

At the moment, read_object is required because parse_save assumes that its stream contains one, and only one, complete object. It thus aims to terminate on EOF.

Changing the termination conditions to include the end of object marker should enable this to be avoided, although additional care will need to be taken with invalid objects.

sapi commented

2 - 2.5x performance boost achieved in 8420748

Further work may be needed, but would likely necessitate either:
(a) a different parsing strategy; or
(b) a C implementation