BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Json.NET 8 Introduces ArrayPools for Performance Gains

Json.NET 8 Introduces ArrayPools for Performance Gains

This item in japanese

Json.NET creator James Newton-King has produced the 8th version, and is focused on improving performance to match what he feels is a broader performance-based intiaitive in the .NET ecosystem as a whole.  For this release (its first since June 2015), Json.NET is doing so by adding a new interface that is intended “to reduce allocations and memory usage when serializing”.

Called IArrayPool, this interface lets Json.NET to reuse array buffers which provides the foundation for the performance gains.  Newton-King calls this “a somewhat experimental feature” so only those who currently have a need should enable it.

Another change for version 8 is that comments in the JSON that is being read into JArrays are now ignored.  This change is being done to eliminate a common source of errors, but the previous behavior can be enabled by CommentHandling.Load on JsonLoadSettings.

Beyond these changes version 8 includes over 2 dozen minor bug fixes, unless there is a version specific reason holding you back, consider upgrading to the latest version.  Links to the source code and project files is available on GitHub.

Rate this Article

Adoption
Style

BT