BGE Python API
Use 'const char *' rather then the C++ 'STR_String' type for the attribute identifier of python attributes. Each attribute and method access from python was allocating and freeing the string. A simple test with getting an attribute a loop shows this speeds up attribute lookups a bit over 2x.
This commit is contained in:
@@ -59,7 +59,7 @@ public:
|
||||
|
||||
bool CheckEqual(CValue* first,CValue* second);
|
||||
|
||||
virtual PyObject* _getattr(const STR_String& attr);
|
||||
virtual PyObject* _getattr(const char *attr);
|
||||
|
||||
KX_PYMETHOD(CListValue,append);
|
||||
KX_PYMETHOD(CListValue,reverse);
|
||||
|
||||
Reference in New Issue
Block a user