Hello List
Whenever something is changed in the document, Inkscape does the following:
1. Store the change in the DOM tree (aka SP tree). 2. Write the change to the XML, also storing undo data. 3. In response to this XML change, update / recompute the values in the DOM tree.
This means that when a path is changed in the node editor, the following happens:
1. Geom::PathVector is constructed from the UI nodes. 2. A path string is constructed. 3. Path string is written to XML. 4. XML observer catches the XML write event. 5. Path string which was just written is parsed, and Geom::PathVector is created.
I guess you can see where this is inefficient. Note however that due to the fact we support "output precision" (i.e. by default the values written into the file have at most 8 digits after the decimal point, so we lose any precision above that), the PathVector created in step 5 is different than the vector created in step 1.
One way to improve Inkscape's performance is to avoid the readback step after every change. In many cases, it leads to large portions of the DOM tree being unnecessarily recomputed. However, not doing readback is rather dangerous - if what we write does not actually parse back to what we have, we end up with data corruption - we are displaying a document that does not match the one that we would display when reopening the file.
Therefore, the way to go would be to have the development version always do readback, while the release version would just assume it wrote the correct data. In the case of paths and other coordinate values, I think we should always store them with full double precision, taking advantage of the double-conversion library (I incorporated it into in 2Geom), and only allow reducing the precision in a separate output filter.
What do you think?
Best regards, Krzysztof