NickHu / homotopy-io

Rewritten homotopy-core
3 stars 2 forks source link

Memoization #15

Open jamievicary opened 4 years ago

jamievicary commented 4 years ago

It would be good to discuss how memoization could work for the new codebase. The primary advantage would be to avoid creating duplicate instances of the main Diagram and Rewrite data structures. It may also be convenient to be able to cache other expensive quantities, like the slices of a given diagram, the computation of which can otherwise be a bottleneck during rendering. But getting this wrong could easily lead to too much being cached and excessive memory usage.