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

Speed up DictionaryBrowser #368

Closed
francisco-dlp opened this issue Sep 3, 2014 · 2 comments
Closed

Speed up DictionaryBrowser #368

francisco-dlp opened this issue Sep 3, 2014 · 2 comments

Comments

@francisco-dlp
Copy link
Member

As discussed in #363, DictionaryBrowser is currently the performance bottleneck for Signal creation and, therefore, for indexing.

One way to speed it up is to make it lazy, i.e. the DB machinery is not run until the __getattribute__ method is executed.

@francisco-dlp francisco-dlp added this to the 0.7.4 milestone Sep 3, 2014
@pburdet pburdet modified the milestones: 0.8, 0.7.4 Oct 13, 2014
@to266
Copy link
Contributor

to266 commented Oct 20, 2014

Here I found a similar thing here
It seems to be a bit quicker to create as well:

    In [1]: from hyperspy.misc.utils import  DictionaryTreeBrowser
    In [2]: import attrdict
    In [3]: life = {'bigBang' :{'stars':{'planets': {}}}}
    In [4]: %timeit a = attrdict.AttrDict(life)                                                                   
    10000 loops, best of 3: 54.6 us per loop
    In [5]: %timeit b = DictionaryTreeBrowser(life)
    10000 loops, best of 3: 89.1 us per loop

obviously it does not have all the same features (i.e. printing, set_item, etc), but that can be possibly added if needed.
From a quick glance, the implementation seemed to be different, though, which is a good thing

@jlaehne
Copy link
Contributor

jlaehne commented Mar 28, 2021

@ericpre can we close this issue now?

@ericpre ericpre modified the milestones: Wish list, v1.6.2 Mar 28, 2021
@ericpre ericpre closed this as completed Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants