Patch Notes:
- Replaced JSON-based data serialization with sys.serialize and sys.deserialize functions for improved reliability and performance.
- Added defsave_ext module with encode_base64 and decode_base64 functions to convert between byte buffers and base64 strings.
- Introduced defsave.use_serialize variable to enable the new serialization method.
Benefits:
- Avoids issues with JSON encoding creating null userdata for sparse array elements.
- Eliminates the "Cannot serialise table: excessively sparse array" error when using highly sparse arrays.
- Provides a more efficient and robust approach to data serialization and deserialization.
To use the new serialization method, set defsave.use_serialize to true.
Thanks @KorolevSoftware !