You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#118 made isVisiblemore than 50% faster by changing the implementation to check for clickability of an element rather than a bunch of styles for it and its ancestors.
It does not currently memoize the results, however, due to some challenges including running into an infinite recursion with the note method.
Due to limitations of the note method[1], we would likely be better served to take a more Map-like approach. However, one concern about the Map approach is that, as a global variable, it can grow in an unbounded fashion and consume a lot of memory (for example, the sample Amazon page I used for profiling in PR #118 had upwards of 6000 elements). We should be able to limit its RAM use if we implement a LRU (least recently used) cache and limit the maximum number of elements stored in the cache.
[1]: Per Erik, the note method assumes one rule writes the note while another rule reads it. Also, isVisible doesn't know what type of fnode we're dealing with, and notes are based on type. Changing these assumptions for the note method would require some significant work.
The text was updated successfully, but these errors were encountered:
To restate in my own words, in case I have to think about this again, notes aren't really a suitable approach to this, since we have the same rule reading and writing. Currently, their design assumes one type writing and another, dependently typed rule reading.
Related to: #91
#118 made
isVisible
more than 50% faster by changing the implementation to check for clickability of an element rather than a bunch of styles for it and its ancestors.It does not currently memoize the results, however, due to some challenges including running into an infinite recursion with the
note
method.Due to limitations of the
note
method[1], we would likely be better served to take a moreMap
-like approach. However, one concern about theMap
approach is that, as a global variable, it can grow in an unbounded fashion and consume a lot of memory (for example, the sample Amazon page I used for profiling in PR #118 had upwards of 6000 elements). We should be able to limit its RAM use if we implement a LRU (least recently used) cache and limit the maximum number of elements stored in the cache.[1]: Per Erik, the
note
method assumes one rule writes the note while another rule reads it. Also,isVisible
doesn't know whattype
offnode
we're dealing with, and notes are based on type. Changing these assumptions for thenote
method would require some significant work.The text was updated successfully, but these errors were encountered: