4 ms·
It's worth the work heading to System.Text.Json - even if only to make staying up with .NET easier for yourself. It had a bit of a rough start but it seems far
by smackeyacky 4y ago
It's worth the work heading to System.Text.Json - even if only to make staying up with .NET easier for yourself.
It had a bit of a rough start but it seems far more interoperable on weird edge cases than Newtonsoft now, so all the "Newtonsoft-y" things you're doing might evaporate.
- snarfy 4y agoI've had the opposite experience. System.Text.Json adheres extremely close to the RFC and barely handles any edge cases. Newtonsoft will happily serialize invalid json. Not that you want that but if you have a legacy system it's not worth migrating. James Newton-King is a Microsoft employee btw.
- runevault 4y agoIsn't Text.json also faster at this point because it uses all the new span goodness and the like?
- jcparkyn 4y agoI'm pretty sure it's been faster for as long as it's existed.
- twisteriffic 4y agoTurns out it's easy to be fast if you don't have any features.
- sebazzz 4y agoEven better: it has an optional source generator now! So, at compile time, C# can be generated. This can be at two levels: (1) just generate metadata so runtime reflection is not needed, or (2) also generate code that does the serialisation or deserialization itself. Pretty cool!