Replies: 1 comment 1 reply
-
In case other people are curious regarding the performance implications of using System.Text.Json as the serializer, @ReubenBond discusses it in this video: https://www.youtube.com/live/kgRag4E6b4c&t=1617 timestamp 26:57. The built-in serializer is about one one-order of magnitude faster most of the time, which is quite a meaningful performance difference (even though we are talking about nanoseconds here). As far as we are concerned, we'll only reach out to the native serializer only on performance critical paths where we expect serialization to be quite intensive, or when we reach such a large scale that these nanoseconds start to move the needle as they add up. We're far from being at that place though 😄 Just putting this information here in case it is useful, in particular for folks using Orleans from F#, since the convenience of using System.Text.Json is important since we do not have code generators & Cie. |
Beta Was this translation helpful? Give feedback.
-
One thing that I hadn't realize was that Orleans is able to use System.Text.Json (and Newtonsoft) side-to-side with the native high-performance serializer.
This is a game changer and removes a lot of friction especially for folks like me using Orleans from F# where we do not have the roslyn powered source-generation tools.
While using System.Text.Json makes us lose some powerful features, such as object reference preservation, it is a great tradeoff to get development velocity. Especially since JsonConverters & Cie are typically already configured for the web api layer, so this makes passing rich messages to Orleans frictionless. And in F#, since objects are immutable, functions are built on the assumptions that we are working with copies of the data, not with a mutable reference.
Just wanted to thank you and highlight how massively useful this feature is. I'd be curious to know how much of a performance hit using System.Text.Json is compared to the native serializer, but I suspect that this will not make much difference for us anyway until we reach quite a large scale.
Beta Was this translation helpful? Give feedback.
All reactions