[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Attempting to reduce the memory footprint of my PyQt5 application
From:       Florian Bruhin <me () the-compiler ! org>
Date:       2016-09-07 5:37:27
Message-ID: 20160907053727.duzhv3ewc3cnvufh () tonks
[Download RAW message or body]

This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.

[Attachment #2 (multipart/signed)]
This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.


* David Boddie <david@boddie.org.uk> [2016-09-07 01:03:30 +0200]:
> On Tue Sep 6 05:22:29 BST 2016, Xavion wrote:
> 
> > I'm trying to cut down on the memory usage of my PyQt5 application.  I'm
> > assuming that one way to do this is to only import the Qt submodules that
> > are actually used.
> > 
> > The three attached files illustrate my point.  The Qt5 Designer only
> > imports the necessary submodules (e.g. "QtCore/QVariant").  Whereas, the
> > PyQt5 UIC and RCC generators import the parent modules in full (e.g.
> > "QtCore").
> 
> In PyQt, unless I'm mistaken, you get the whole module when you import a
> class from it so there's no way to just import the classes you use. There
> may be some tricks done to save memory at run-time but you will already be
> benefiting from those.

Correct - not only in PyQt, but in Python in general. Basically,
"from foo import bar" is equivalent to:

    import foo
    bar = foo.bar
    del foo

Florian

-- 
http://www.the-compiler.org | me@the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/

["signature.asc" (application/pgp-signature)]
[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic