I have written a JSON parser that takes any valid json string and generates hash tables and object lists.
When parsing a 100 mb json file with 1 million objects (each with 4 fields) it does about 20,000 objects/second and the entire file in 46 seconds.
Does this seem good, bad, average?
Stopwatch watch = new Stopwatch();
Console.WriteLine("Starting parser...");
watch.Start();
object o = JsonParser.Parse(json);
watch.Stop();
Console.WriteLine("Stopped parsing...");
Console.WriteLine("Ms: " + watch.ElapsedMilliseconds);
Edit: the test was done on a desktop with dual core 2.6ghz cpu and 4 gig ram
It isn’t good, nor bad nor average without context. On it’s own, one could interpret that 46 seconds as lightning fast, or dog-slow. You’ll need to compare it with other JSON parsers out there and time how long it takes them to parse the same data.
Once you’ve decided that you’re either slower or faster than competition and you have some context, you then need to decide if it’s too slow for the use in which it is intended.
Only then can you decide whether the performance is good, bad or average 🙂