We can run a script on every scene update in Blender using event handlers
bpy.app.handlers.scene_update_post(). But even with a minimal script, having it run on each scene update seems to be very taxing on the CPU. Blender has probably thousands of lines of code in C run at each frame update and is handling it with ease. But seems to struggle when adding a few extra lines of code with python to that loop. Do you guys think the issue here is with python being very slow to execute the code compared to C?
I just started using Animation Nodes addon for example which is great, but having it run with auto-execution on is very processor intensive. The addon is using event handlers wnich seem to be the issue.