You have a really nice comparison tool and we have used it to help us with improving our code. So thanks.
Please update the DynamicDataObjects library for your performance tests as the performance for duplicate slots is greatly improved to work within test cases that have a high number of fields in an object.
But the performance test you have is a bit janky. It really isn't a performance test on serializing or deserializing, but rather is a performance test that is centered around objects with a large number of fields in one object. Which is an extremely rare use-case for JSON. The problem with the test is it only tests string values so numerical value validation is never exercised, and the majority of the test is stressing performance around an object having many fields. The problem is that you are explicitly turning OFF the duplicate field searching and testing to make some of the libraries look faster, but then turning on the duplicate field searching when performing the serialization error testing to make them look testing complete. So when you compare some libraries that do properly perform duplicate field testing against other libraries that have that check turned off, you are getting great performance results for some libraries that are actually not performing the duplicate field checking. This is an issue for both generating and loading. The test should be a big file test, but not where you have thousands of fields with slightly different names because that is a non-realistic test case.
At least have all the libraries properly perform the duplicate field checking when doing the performance test. For the Generating and for the Loading tests, duplicate field checks should always be enabled for all libraries so they can properly be compared with each other. For example, in the McJson performance test, you have the following call:
procedure TMcJsonItem.fSetAsJSON(aValue: string);
begin
if (Self = nil) then Error(SItemNil, 'set as JSON');
// speed up = no key duplication verification (default)
Self.parse(aValue, True);
end;
Passing in "True" for the .Parse() call means that it is skipping duplicate field checking. Of course it will be faster than others that do properly do the check. Knowledge is freedom.
You have a really nice comparison tool and we have used it to help us with improving our code. So thanks.
Please update the DynamicDataObjects library for your performance tests as the performance for duplicate slots is greatly improved to work within test cases that have a high number of fields in an object.
But the performance test you have is a bit janky. It really isn't a performance test on serializing or deserializing, but rather is a performance test that is centered around objects with a large number of fields in one object. Which is an extremely rare use-case for JSON. The problem with the test is it only tests string values so numerical value validation is never exercised, and the majority of the test is stressing performance around an object having many fields. The problem is that you are explicitly turning OFF the duplicate field searching and testing to make some of the libraries look faster, but then turning on the duplicate field searching when performing the serialization error testing to make them look testing complete. So when you compare some libraries that do properly perform duplicate field testing against other libraries that have that check turned off, you are getting great performance results for some libraries that are actually not performing the duplicate field checking. This is an issue for both generating and loading. The test should be a big file test, but not where you have thousands of fields with slightly different names because that is a non-realistic test case.
At least have all the libraries properly perform the duplicate field checking when doing the performance test. For the Generating and for the Loading tests, duplicate field checks should always be enabled for all libraries so they can properly be compared with each other. For example, in the McJson performance test, you have the following call:
procedure TMcJsonItem.fSetAsJSON(aValue: string);
begin
if (Self = nil) then Error(SItemNil, 'set as JSON');
// speed up = no key duplication verification (default)
Self.parse(aValue, True);
end;
Passing in "True" for the .Parse() call means that it is skipping duplicate field checking. Of course it will be faster than others that do properly do the check. Knowledge is freedom.