Currently, I'm using KeePass 2.23 on a relatively slow machine (netbook). The problem is, that program hangs for about 10s when I'm trying to close process completely. I analyzed shutdown procedure and found, that the most time-consuming operation is instantiating a XmlSerializer object, which is done in XmlSerializerEx.Deserialize() to save config. The XmlSerializer object can be reused and there is no need to create it each time the method XmlSerializerEx.Deserialize() is invoked, as type of deserializer is always the same. Therefore, I changed the class:
1) created new private property
private XmlSerializer xs;
2) instantiate xs object once, in class constructor:
xs = new XmlSerializer(m_t);
3) In the end of Deserialize() method just use
without creating new object.
Now, the closing procedure is much faster.
KeePass only instantiates XmlSerializerEx objects for the types AppConfigEx and KPTranslation. For both of these, explicit deserialization code exists, i.e. the code you mentioned is never called (and thus cannot influence the shutdown performance), at least not without a plugin.
Strange. In my configuration, when putting breakpoint on this method it was invoked and resulted in a noticeable delay. I started program setup from scratch without addons and now it works without this method.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.