I would suggest to not use json but instead keep using lua. This would be more faster to load.
For some project where I actually parse files, I sometimes export the result as Lua file that I can load later because it is so much faster to do so (https://devforum.play.date/t/a-list-of-helpful-libraries-and-code/221/72). I would imagine that using Lua file would even be faster than binary file actually (that you would still need to read and convert as Lua table anyway).
If a lua file in your project is not called by any other file using import
, pdc
will save it as a pdz file (which is mostly Lua byte code) and you can load it using playdate.file.load()
or playdate.file.run()
Here an example code where I load a pdz file.
https://devforum.play.date/t/splitting-a-game-into-several-functional-binaries-nics-plugin-manager/1387/5