PYQT - help profiling python code {built-in method exec_} -


I am developing a software in PyQt to edit the tile map in a game - it's a lot of things for me Support is the game.

My game has mainly small maps, but I wanted to try to do a bigger map - but unfortunately, my editor looks sluggish with a big map - especially on creation . Each tile in the editor has a label with an image. That's why I did a 90x90 map on it and what to put it to understand using the Python profile.

  python -m cProfile editor.py & gt; Profile.log   

The rows reaching more than one second in total are below:

  ncalls tottime percall cumtime percall filename: lineno (function) 8205 22.397 0.003 22.397 0.003 {Underlying method shows} 1 5.0 9 5.0 9 37.913 37.913 {Underlying method exec_} 1 1.824 1.824 1.824 1.824 {getExistingDirectory} 1 1.038 1.038 1.038 1.038 {question}   

OK , Then get it from time to time to select the directory from the hosting directory, so I am leaving it.

The exit show is called 8205 times! Since there are 8100 tiles in the map, I think that is related - I have created a 90x90 map, which is 8100 tiles. Also, there are other controls in the screen and even there are a palette with 117 elements - all other controls probably make at least 200 widgets.

Therefore, tiles which are in the central widget. Click on the new file. My question is whether it is a distant, so that each label can be called once for the widget, Once said, where are they inside?

Update:

I'm showing myself on the construction of everyone, I deleted the call! Unfortunately, the time has increased.

  ncalls tottime percall cumtime percall file name: lineno (function) 1 43.588 43.588 53.901 53.901 {implicit method exec_} 1 2.325 2.325 2.325 2.325 {getExistingDirectory} 1 1.447 1.447 1.447 1.447 {Question} 2 0.265 0.132 1.773 0.887 Editor_Zarrow (Draw) 8452 0.244 0 0.244 0 {Underlying method scale} 8442 0.227 0 1.233 0 Tile Xlappa 31 9 9 (Inttil) 24852 0.221 0 0.221 0 Construction-these method connected} 42260 0.128 0 0.128 0 {PIL._imaging .alpha_composite} 42260 0.077 0 0.115 0 image.py:472(_new) 8452 0.077 0 0.24 0 ImageQt.py:44(__init__) 8452 0.074 0 0.074 0 Image from {0} 42260 0.072 0 0.403 0 Image.py:2033(alpha_composite ) 1 0.064 0.064 54.158 54.158 editor.py:3(<module>) 8452 0.042 0 0.042 0 {'Imaging Encoding R 'object' encoded '} 8452 0.038 0 0.132 0 Image.py-1230 (tickets) 67740 0.036 0 0.05 0 Image.py:628 (loaded) 24852 0.033 0 0.033 0 {PyQt4.QtCore.SIGNAL} 42664 0.03 0.03 0 Image.pychie61 (__ init__)    

found solution.

In the drawings of the widget with multiple widgets, hide it, then show in pyqt using QWidget.setVisible (self, bool visible) such as:

  class BigWidget (QWidget): def __init __ (self, original = none, ** kwargs): QWidget .__ init __ (self, parent, ** kwargs) ... Def DrawManyWidgets , Parent): Self set visible (false) ... Self. Settleable (True)    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -