Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #77746
| References | (5 earlier) <540E40FD.8030706@gmail.com> <540E69AF.5040309@riseup.net> <540F1D83.1010602@gmail.com> <CAPTjJmrRn0mK1CA33R0JSi9ZGM9ULf5Hv7yNmugvaxe77UmByQ@mail.gmail.com> <540F234E.1080901@gmail.com> |
|---|---|
| Subject | Re: weakref, memory management and execution slow down in PyQt4 |
| From | kjs <bfb@riseup.net> |
| Date | 2014-09-09 10:28 -0700 |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.13910.1410283736.18130.python-list@python.org> (permalink) |
On September 9, 2014 8:57:02 AM PDT, Michael Torrie <torriem@gmail.com> wrote: >On 09/09/2014 09:37 AM, Chris Angelico wrote: >> On Wed, Sep 10, 2014 at 1:32 AM, Michael Torrie <torriem@gmail.com> >wrote: >>> Yes you're correct. It is the equivalent. But it always involves >>> lookup in the object's dictionary, which is big O order O(n log n) >>> complexity for each and every access. >> >> Where do you get that figure from? A CPython dictionary is >implemented >> as a hashtable, so algorithmic complexity of lookups ought to be >O(1). > >You're right, it is. My mistake. Guess the main issue is the overhead >of an additional function call. A dict directly or a list directly may >me faster. > >Anyway, I guess we're wandering in the weeds a bit as the original >issue >is probably not related to his unorthodox choice of metaprogramming as >a >data model. I agree. I believe I have isolated the issue to be either my user of pyqtgraph, or is implementation. I lean towards the my use, because I know how little effort I put into understanding the library. If I figure on a solution, I'll be sure to come back in. I'm also curious why the weakrefs are not being garbage collected. And how many (~20,000) tiny little things can bring processing to a halt after only a couple minutes of runtime.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: weakref, memory management and execution slow down in PyQt4 kjs <bfb@riseup.net> - 2014-09-09 10:28 -0700
csiph-web