This Engineering Notebook post discusses when to use Positions and when to use VNodes. The general rules:
1. Prefer VNodes to Positions if possible, but
2. Most outline operations must use Positions.
Examples
Outline commands such as insert-node, delete-node, and paste-node must use Positions because c.p affects what parent VNodes Leo must update.
When writing a .leo file, Leo must scan all nodes to find dirty @<file> nodes. Using c.all_nodes, an abbreviation for c.hiddenRootNode.self_and_subtree, will be slightly more efficient than c.all_unique_positions. But not enough to matter.
Otoh, v.setAllAncestorAtFileNodesDirty is the perfect place to use v.self_and_all_parents. There is no need to scan the entire outline!
Finally, Leo's outline-drawing code must use Positions because VNodes may appear in multiple places in the outline.
And that's it.
Edward
> When writing a .leo file, Leo must scan all nodes to find dirty @<file> nodes.
> Using c.all_unique_nodes will be slightly more efficient than c.all_unique_positions. But not enough to matter.
The timeit script below shows that c.all_unique_nodes is about three times faster than c.all_unique_positions. On my machine the output is something like this:positions 0.012876
vnodes 0.004999