0

I've been trying to bundle up some splash screens into a resource file (three of them, at around 350KB each) using pyrcc, but the resulting rc takes an unacceptable amount of time to import (about 1.2 seconds).

I assume this is just a limitation of python's import system, as it doesn't usually have to, nor should it have to, import such a gigantic source file (5MB file, 72k lines). Am I thinking about this problem the right way? Is there a way to skirt around PyQt's qrc-to-module workflow while still maintaining all assets in the resource system?

ekhumoro
  • 115,249
  • 20
  • 229
  • 336
spencewah
  • 2,196
  • 4
  • 20
  • 31
  • I cannot reproduce this. Using three 500Kb images, I created a 6.5Mb resource module. On linux, importing this module takes about 0.15sec on the first pass, and only about 0.025sec thereafter (due to file caching). – ekhumoro Mar 12 '16 at 02:08
  • Hmm, I'll try it out on my linux box and see if it makes a difference. This is currently running on Windows 7, python27 – spencewah Mar 13 '16 at 03:38
  • The module is mostly just one huge byte-string. Importing it shouldn't be much different than just opening the file and reading it into a variable. And indeed if I do that, the timimgs are almost identical. So, on the face of it, 1.2 seconds to import/read a 5Mb module seems a little odd. – ekhumoro Mar 13 '16 at 04:10

0 Answers0