[PyQt] Attempting to reduce the memory footprint of my PyQt5 application

Florian Bruhin me at the-compiler.org
Thu Sep 8 11:04:05 BST 2016


* Xavion <xavion.0 at gmail.com> [2016-09-08 07:57:22 +1000]:
> So, you're both saying that the following two lines are equivalent (from a
> memory footprint standpoint):
> 
>    - from PyQt5.QtCore import QVariant
>    - from PyQt5 import QtCore
> 
> In other words, in both cases, the whole of 'QtCore' will be imported
> (rather than just 'QVariant' in the first case).

Right.

> Florian: I think you're saying that I can reduce the memory usage by doing
> the following.  If so, can we get the UIC and RCC generators to behave this
> way?
> 
>    - from PyQt5 import QtCore
>    - mVariant = QtCore.QVariant
>    - del QtCore

No, that's not what I was saying - I was just saying this is roughly
what happens behind the scenes when you do "from PyQt5.QtCore import
QVariant". The "del QtCore" just makes that name unavailable again, it
doesn't change anything from a memory point of view.

Florian

-- 
http://www.the-compiler.org | me at 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/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160908/dcb0ba0a/attachment.sig>


More information about the PyQt mailing list