titan-studio / coeus

Pure LuaJIT game engine with a focus on fast development and high quality games
zlib License
25 stars 0 forks source link

C Struct Types #31

Closed LPGhatguy closed 9 years ago

LPGhatguy commented 9 years ago

We should implement C struct types for various primitives instead of using full-on classes. This will significantly improve our performance and memory usage significantly so we don't haul around Lua function references with every piece of data.

LPGhatguy commented 9 years ago

There's a fantastic alternative to this I'm investigating. Instead of converting our entire API over to using C structs, we could continue using Lua types for most data with an extra metatable to access immutable types located in the class definition.

This means no function pointer weight, but would cause two metatable lookups per function access, which might not be ideal. I'll benchmark things.

LPGhatguy commented 9 years ago

Closing this issue as unnecessary