It can happen that the Runtime attribute incorrectly returns 0 after optimizing. This is most likely due to a known issue with calling
model.write() before querying the Runtime attribute.
To obtain the correct runtime, please query the Runtime attribute immediately after the
model.optimize() call. This behavior will be fixed in the next major release.