[KongchangAI]
ConceptStructural Sharing

structural sharing

A key mechanism by which persistent data structures achieve low copying cost. When immutable data is modified, unaffected parts are reused and only the path from the modification point to the root node is newly created, so the cost of a single update is of the same order as for a mutable structure.

Timeline (last 90 days)

Oct 24

Structural sharing is the key mechanism by which persistent data structures achieve low copying cost, reusing unaffected parts upon modification and creating only the path from the modification point to the root node.

Unverified50%
Oct 24

Inserting an element into a persistent balanced tree requires copying only O(log n) nodes, with the remaining subtrees shared via pointers, so the cost of a single update is of the same order of magnitude as for mutable structures.

Unverified50%
Oct 24

The cost of structural sharing lies in extra pointer indirection and poorer cache locality, which is one reason pure FP lags behind C on some memory-intensive workloads.

Unverified50%

All Facts (3)

Source Articles