Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77718

Re: weakref, memory management and execution slow down in PyQt4

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.014
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'true)': 0.09; 'python': 0.11; 'assume': 0.14; 'language.': 0.14; 'foo,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'retrieving': 0.16; 'subject:slow': 0.16; 'variable.': 0.16; 'language': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'header:X-Complaints- To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; 'code': 0.31; 'class': 0.32; 'there,': 0.34; 'done': 0.36; "didn't": 0.36; 'performance': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'profile': 0.61; 'simply': 0.61; "you're": 0.61; 'first': 0.61; 'making': 0.63; 'guarantee': 0.63; 'our': 0.64; 'different': 0.65; 'charset:windows-1252': 0.65; 'ever.': 0.84; 'gut': 0.84; 'imagine': 0.93; 'online,': 0.96
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: weakref, memory management and execution slow down in PyQt4
Date Tue, 09 Sep 2014 08:43:29 +0100
References <540BFE43.5030006@riseup.net> <loom.20140907T152314-538@post.gmane.org> <540CADDD.3050501@riseup.net> <540CB15C.2060008@gmail.com> <540CC278.4050106@riseup.net> <540E40FD.8030706@gmail.com> <540E69AF.5040309@riseup.net>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host host-92-18-5-249.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0
In-Reply-To <540E69AF.5040309@riseup.net>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.13891.1410249864.18130.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1410249864 news.xs4all.nl 2973 [2001:888:2000:d::a6]:55623
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:77718

Show key headers only | View raw


On 09/09/2014 03:45, kjs wrote:
>
> You're right, a dictionary can do everything I need and more. This
> happened to be the first thing I thought of, and I didn't imagine it
> would be very expensive. I figured it was simply a different way of
> defining and retrieving a class variable. IE setattr(self, foo, True) ==
> self.foo = True.
>

My rule of thumb for making a judgement on Python performance is never 
assume anything, ever.  In using Python for well over 10 years my gut 
instinct has never been correct on this matter.  The only thing to do is 
profile your code and then seek the answers online, as you can guarantee 
someone else has already been there, seen it, done it and got the t-shirt :)

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: weakref, memory management and execution slow down in PyQt4 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-09-09 08:43 +0100

csiph-web