Performance optimization 2
After solving issue #434 (closed) the performance of model extensions is significantly improved. This change avoids loading all Fireworks of the model into memory and then using only those of them that are parents of the fireworks in the extension.
The FWAction has to be applied and in the case of update_spec
action data must be propagated to the spec dictionaries of all children. Therefore, the action key of the representative launch of every parent must be read.
The relevant places in the code are Workflow.apply_action
and Workflow.append_wf
. The Workflow.apply_action
is called by the rocket launcher after completing a launch. The Workflow.append_wf
is called via launchpad at the time a workflow is extended or by the rocket launcher after completing a launch if the action includes detours and additions.
In these two cases a de-serialization / serialization cycle is carried out but is actually not needed.
One way to avoid this unnecessary de-serialization / serialization is to avoid the immediate evaluation of the datastore contents but defer this process to the point when the value saved is actually needed. This requires modification of the derialization / deserialization methods in class FWDataObject
in serializable.py
.
A second way (preferred way) is to avoid calling the deserialization by modifying FireWorks at the places above. One can show that it is safe to avoid/skip deseriaization of update_spec data deserialized to only store it in the children fireworks.