drmrd/tiddlymath

Inefficient typesetting on page changes

Closed this issue · 0 comments

drmrd commented

The MutationObserver currently being used to monitor changes too page content is very crude, having MathJax typeset the entire page whenever any change to the story river is observed. There is plenty of room for improvement here, but the first optimizations that come to mind are the following:

  • change the MutationObserver's configuration data to not monitor irrelevant changes (e.g., if we're monitoring the subtree of the story river node, do we really care about its children and/or attribute changes?)
  • change the callback function so that it actually considers what type of change occurs
  • change the typesetting call to the particular DOM node in the MutationRecord.