JsonValue versus JsonObject - Printable Version +- Curl Global Community (https://communities.curl.com) +-- Forum: Blogs (https://communities.curl.com/forumdisplay.php?fid=17) +--- Forum: Tech blog (https://communities.curl.com/forumdisplay.php?fid=18) +---- Forum: Robert blog (https://communities.curl.com/forumdisplay.php?fid=20) +---- Thread: JsonValue versus JsonObject (/showthread.php?tid=505) |
JsonValue versus JsonObject - RobertShiplett - 05-28-2012 It is my experience now that where performance is concerned, it is important to move as quickly as possible from a collection of JsonValue to a collection of JsonObject. What you escape in that way is both any-casts and any-calls. If I have an array of JsonValue, I iterate over it with asa JsonObject within {with-compiler-directives allow-implicit-any-casts? = true do } to create a collection of type JsonObject. The difference in performance has been dramatic: 10 seconds for several hundred records versus 1+ second - so about an order of magnitude improvement. I am only using JSON because I have made some files available in that format. My next efforts will be with using Curl value classes for multiple name-value associations of type String. UPDATE: a comparison of the JSON to the Curl data is posted at http://lcurlr.blogspot.ca/2012/05/curl-versus-json.html |