Defold-CJSON Native Extension for the Defold Game Engine
This extension allow you encode lua table to JSON and decode JSON to lua table in native part
- iOS
- Android
- MacOS
- Windows
You can use the Defold-CJSON extension in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:
https://github.com/Melsoft-Games/defold-cjson/archive/master.zip
Or point to the ZIP file of a specific release.
return encoded lua table to json string
return parsed lua_table
Note: json must be valid, or cjson will throw error. You can wrap it with pcall, or change extension and call cjson safe_decode from lua-cjson lib
rxlua - pure lua JSON encode/decode implementation
time in ms
Json: | 4KB | 971KB | 1.8MB |
---|---|---|---|
defold decode | 0 | 0.032 | 0.075 |
-- | -- | -- | -- |
rxlua encode | 0 | 0.0734 | 0.148 |
rxlua decode | 0.0003 | 0.0308 | 0.051 |
-- | -- | -- | -- |
cjson encode | 0 | 0.0057 | 0.0122 |
cjson decode | 0 | 0.0066 | 0.0117 |
MIT license This NE wrapped by Denis Smirnov
Original module: lua-cjson License
If you have any issues, questions or suggestions please create an issue or contact me: [email protected]