Skip to content

Optimize subject_graph.update with relationship delta determination #12

@dnorman

Description

@dnorman

context::subject_graph is an essential part of the context materialization and compaction mechanism ( which itself is essential to the efficient functioning of the system)

When applying a new MemorefHead to one of the context's subject_heads, we need to update subject_graph to permit efficient topological sorting of subjects later.

At present, this is implemented in a quick-and-dirty way using a fully materialized array of possible relation slots. This presently requires the allocation of at least 2kb each time ( likely far more when subjects switch to uuids ), and much unnecessary work, as it will be very rare for all relations of a subject to change at once. Given how frequently we intend to do this ( every time a subject is edited locally, or remote edits received ) This seems like a good target for optimization.

Proposed approach: create a special mode of memorefhead.apply that calculates which relations are being changed, and individually updates subject_graph appropriately

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions