I was able to make some meaningful performance improvements in deserializing large json files by changing JsonTextReader.cs to use the Ordinal string comparer instead of using InvariantCulture.
As far as I am aware, this change should not break the code for any device with any culture since the code is already explicitly using InvariantCulture. Given the strings we are checking for are all simple hard-coded strings with English characters and a few symbols ($, {, }, [, ]) there should be no difference in the results of an Ordinal or InvariantCulture equality comparison.
Please advise if there is indeed a case where this could potentially break something
Hi,
I was able to make some meaningful performance improvements in deserializing large json files by changing
JsonTextReader.cs
to use the Ordinal string comparer instead of using InvariantCulture. As far as I am aware, this change should not break the code for any device with any culture since the code is already explicitly using InvariantCulture. Given the strings we are checking for are all simple hard-coded strings with English characters and a few symbols ($, {, }, [, ]
) there should be no difference in the results of an Ordinal or InvariantCulture equality comparison.Please advise if there is indeed a case where this could potentially break something