From my benchmark JsonDataObjects is the fastest lib for read write json in delphi, It's awersome! but is poor in documentation.
I'm searching for examples for writing large json (over 50000 nodes, less or more 90 MB) with the best performance.
Eg. is better writing the objects with the full path:
var
Obj: TJsonObject;
i: integer;
begin
Obj := TJsonObject.Create;
for i := 0 to 50000 do begin
Obj['foo']['bar']['baz'].A['array'].Add(i);
end;
Obj.Free;
end;
or write by caching the parent, eg.:
var
Obj: TJsonObject;
aArray: TJsonArray;
i: integer;
begin
Obj := TJsonObject.Create;
aArray := Obj['foo']['bar']['baz'].A['array'];
for i := 0 to 50000 do begin
aArray.Add(i);
end;
Obj.Free;
end;
From my benchmark JsonDataObjects is the fastest lib for read write json in delphi, It's awersome! but is poor in documentation.
I'm searching for examples for writing large json (over 50000 nodes, less or more 90 MB) with the best performance.
Eg. is better writing the objects with the full path:
or write by caching the parent, eg.:
other trick and tips are welcome!