Paul Krill
Editor at Large

Microsoft .NET JSON serializer could get faster startup

news
Jan 8, 20212 mins

Improved throughput and reduced application size are also on the drawing board for the System.Text.Json serializer.

hyper convergence speed burning rubber tire binary fast by tao55 getty images
Credit: Toa55 / Getty Images

System.Text.Json, a JSON serialization library in Microsoft’s .NET development platform, could add C# source code generation in an upcoming iteration. The change is designed to improve performance.

Plans call for utilization of new C# source generator capabilities to help the built-in serializer in the following ways:

  • Improve startup and runtime throughput
  • Reduce private bytes usage
  • Reduce application size
  • Improve IL (Intermediate Language) Linker friendliness by avoiding runtime reflection

Efforts to utilize C# source generation in System.Text.Json were in a prototype stage as of mid-December. Microsoft envisions their coming to fruition in .NET 6.0, due in November of this year.

The System.Text.Json library converts .NET object types to a JSON string and vice versa. It supports UTF-8 text encoding and was introduced in .NET Core 3.0. A type in the library, JsonSeralizer, purports to have the highest level of functionality for processing JSON data.

In the new .NET 5, released in November, System.Text.Json gained improvements in performance and reliability, making the library easier to adopt for developers familiar with the Newtonsoft.Json framework.

Other plans in the offing for System.Text.Json include:

  • Extended polymorphic serialization and deserialization
  • Asynchronous serializing and deserializing IAsyncEnumerable<T>
  • The addition of snake_case naming policy
  • Changing default settings for JsonSerializerOptions.
Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author