Continuing from the ideas of #87 , it is probably worthwhile to make a custom entity serializer that uses the EntityDefinition rather than BsonClassMap. Every type that gets an entity definition would automatically get this new serializer applied to it and all of its properties.
While I don't have any specific numbers at the moment, I think there is a good chance to squeeze a lot better performance while lowering allocations.
Ultimately this would still need to use the BsonSerializerRegistry and be otherwise compatible with the default serializer system in the MongoDB driver.
First, this should start with a benchmark of the current serialization system to see what we are dealing with.
Continuing from the ideas of #87 , it is probably worthwhile to make a custom entity serializer that uses the
EntityDefinitionrather thanBsonClassMap. Every type that gets an entity definition would automatically get this new serializer applied to it and all of its properties.While I don't have any specific numbers at the moment, I think there is a good chance to squeeze a lot better performance while lowering allocations.
Ultimately this would still need to use the
BsonSerializerRegistryand be otherwise compatible with the default serializer system in the MongoDB driver.First, this should start with a benchmark of the current serialization system to see what we are dealing with.