running code on cProfile is extremelly quick

   1362   1   1
User Avatar
Member
2 posts
Joined: 1月 2016
Offline
Hi, New to the forum.

I'm currently doing an auto scene builder that reads in some textures, models and descriptions from a json file and loads them into the scene. At some point my code started to runa bit slow so I decided to do a quick cProfile to see where the bottle neck was:

cProfile.runctx('test_call()', globals(), locals())


the code went from around 25 secs to 0.7 seconds to import all the materials and models, my question is why is running the cProfiler runctx function makes the code run so much faster, I'm inclined to believe I'm doing something wrong on how I'm writing this specific python code that houdini doesnt like. does it have to with the fact that cProfile doesn't show a preview on houdini as the materials/nodes are getting created ? , is there a way to “pause” the ui to get similar speed? .

Thanks in advance.
Edited by GuillermoMolina - 2020年11月29日 13:14:58
User Avatar
Member
7871 posts
Joined: 7月 2005
Offline
Random thought maybe hou.ui.setUserInteracting()can help
  • Quick Links