Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize static elements on both data and element id #1396

Closed
jlstevens opened this issue May 2, 2017 · 2 comments
Closed

Optimize static elements on both data and element id #1396

jlstevens opened this issue May 2, 2017 · 2 comments
Assignees
Milestone

Comments

@jlstevens
Copy link
Contributor

Currently only the data id is used in this optimization. If both the element and the data id were used, I think it would still work where it needs to without causing confusing behavior when working with mutable data.

@jlstevens
Copy link
Contributor Author

After discussing this with Philipp we decided we might want something like this:

def plot_id(obj):
   if hasattr(obj, '_plot_id'): 
      return obj._plot_id
   else: 
      return id(obj)

And then the clone method can transfer the parent _plot_id to the clone output. With something like:

   if self._plot_id is not None:
      clone._plot_id = self._plot_id

Hopefully this will allow the static source optimization to work better without worrying about the various uses of clone in the plotting code.

@philippjfr
Copy link
Member

The fix described above has now been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants