metomi/rose — pull request #1117 by benfitzpatrick (2014-02-10 18:34:30+00:00)
Title: rose edit: reduce updating of ConfigNode

Currently, `rose edit` updates an internal `rose.config.ConfigNode` object for
each configuration when a change is made. This is the current bottleneck in
the updating. This takes around `0.1` seconds in very large configurations
when a variable's value is changed.

The reason for having a internal `rose.config.ConfigNode` object is that the
rose compulsory, value, and trigger macros all have an API that demands a
ConfigNode input. This change refactors these macros to allow using the
same logic with a different data object.

Now, an update of a ConfigNode object is only done for running custom
macros, and for saving.

This results in non-global operations being around 4x faster for large
configurations (everything except for loading, switching off metadata, etc).

Additional changes:
* the compulsory macro has been refactored to correctly detect missing
compulsory options in all duplicate sections - previously, it was just
finding the first duplicate section's options. Test the new app to
see the difference in behaviour.
* latent pages with compulsory errors will now correctly display them.

This pull request requires a fair amount of testing:

Does the macro functionality work?
- [x] compulsory checking
- [x] trigger checking
- [ ] value checking (range, pattern, type, values, etc)

Are the config objects updated correctly when they need to be?
- [ ] fail-if checking
- [ ] custom macro running
- [ ] saving