Closed gmanvel closed 8 months ago
This PR introduces schema cache, so that Schema.Create(obj); does not create schema on every AvroConvert.Serializecall, which is currently defined as
Schema.Create(obj);
AvroConvert.Serialize
public static byte[] Serialize(object obj, CodecType codecType) { using (MemoryStream resultStream = new MemoryStream()) { var schema = Schema.Create(obj); using (var writer = new Encoder(schema, resultStream, codecType)) { writer.Append(obj); } byte[] result = resultStream.ToArray(); return result; } }
Note, that it is caching only schemas when AvroConvertOptions are not passed.
AvroConvertOptions
Thank you, another clever idea!
This PR introduces schema cache, so that
Schema.Create(obj);
does not create schema on everyAvroConvert.Serialize
call, which is currently defined asNote, that it is caching only schemas when
AvroConvertOptions
are not passed.