GuidConverter, performance

Nov 12, 2012 at 9:46 AM

I know I could measure myself but I just would like to hear from the creator, if it in general hurts performance when adding custom converters. E.g

public class GuidConverter : JsonConverter
{
	public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
	{
		writer.WriteValue(((Guid)value).ToString("N"));
	}

	public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
	{
		return Guid.Parse(reader.ReadAsString());
	}

	public override bool CanConvert(Type objectType)
	{
		return objectType == typeof (Guid);
	}
}