Skip to content

How efficient is this library? #335

Closed Answered by davdroman
marticztn asked this question in Q&A
Discussion options

You must be logged in to vote

In the "How does it work" section it says it will traverse through all the underlying views until it finds the corresponding view.

This is not entirely accurate. The library only traverses a small part of the hierarchy. Specifically, the part of the hierarchy sandwiched between the bottom and top invisible introspection views for a given .introspect modifier. So in reality, the lookup is performed very quickly because there are at most a few dozen views to sift through at any one time.

In addition to the lookup being fast, once the view is found once it's internally cached by the library and accessed directly on subsequent customize calls (e.g. when triggered by view updates). So really…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@marticztn
Comment options

Answer selected by marticztn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants