Closed totyaxy closed 1 year ago
Hi,
Try to leave the Path()
call outside the loop. Actually, you don't need to call it:
JsonIdx := Json.Add(IndexStr);
for x in Tx do
JsonIdx.Add(x.key).AsString := McJsonEscapeString(x.value);
Could you report how fast is this modification (in % or seconds/milliseconds)?
Regards,
I knew it, there is a faster way than it, thank you!
Old method: 88,5 secs New method: 11.7 secs
It's about 800% faster way, thank you!
Maybe it's a good idea to write something similar in the wiki, because I think it's better read than "issues".
OK
Hi,
I've just commit a new project that might be of your interest:
https://github.com/hydrobyte/TestJSON
I'm planning to create a Lazarus version too.
Regards,
Yes, I am interested, but I can only run fpc/lazarus code. Maybe a deplhi that can be converted by lazarus.
Presumably due to my not quite correct code. I create a json structure this way:
This about look this way (about 150k line):
I think the low generation speed is because of the path usage, can this be fixed somehow? For example If I always write to the last one, the library doesn't need to search through the entire structure.