luabind getting the class metatable of a c++ object to push the obj as argument to lua function
===

I noticed a severe performance hit, introducing one of my c++ objects as a lua function arg e.g.

    function luaFunc(someString)
     print someString
    end

this is pretty fast - less than 30ms for 100k calls

now, i added another object

    function luaFunc(myCObj, someString)
     print somestring
     myCObj:doStuff()
    end

100k calls now take over 1sec. (adding another primitive like int or string as arg has no performance hit! Also, putting the object into global scope (e.g. dont push it each time as func arg, also has no performance hit - but i need it as an argument)

This is how i call it using luabind

     luabind::call_function<void>(fn,myCObj,message);

I was able to reduce the time by 0.5sec by simply using luas pcall function directly - using this "hack":

    // this will automatically set the correct class metatable for me
    luabind::globals(fn.interpreter())["myCObj"] = myCObj; 	
    // push my userdata obj onto the stack including the class metatable
    lua_getglobal(fn.interpreter(), "myCObj");
    lua_pushstring(fn.interpreter(),message);				
    lua_pcall(fn.interpreter(), 2, 0,0));		

Still, i think it can be faster and better - this is what i thought doing

    void *pUserData = lua_newuserdata( fn.interpreter(), sizeof( MyCClass ) );
    pUserData  = myCObj;
    lua_getmetatable(fn.interpreter(),????);  
    lua_setmetatable( fn.interpreter(), -2 );
    lua_pushstring(fn.interpreter(),message);
    lua_pcall(fn.interpreter(), 2, 0,0));

So, i believe luabind manages some metatables for each class - but i dont know how to retrieve it - i saw in the source something about "__luabind_classrep" - additionally - in the globals there is a userdata obj with the name i registered my class to luabind.