I am using Jython's Embeded method to pass an extended PyObject to jython scripts for them to modify. But I was wonder if there is a way to cache .exex() calls as I have jython scripts that never change and constantly calling exec on them is a bit of an overkill.
Jython Example (150~ fps):
co = GameLogic.getCurrentController()
own = co.getOwner()
rot = own.getRotation()
rot += 0.5
Java example (400 ~ fps):
BasicObject co = GameLogic.getCurrentController
BasicObject own = co.getOwner();
float rot = own.getRotation();
rot += 0.5f;
Java is 2.66x (266%) faster then Jython, which really is darn good as I was expection slower 5x-10x.