sinamdar2015 / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

GSON is (very) slow #375

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
i ran a test where a serialized / deserialized a simply bean object with an 
embedded collection (map of string to list of string). GSON was 10x slower than 
Jackson, and 5x slower than org.json. 

i'm not sure a real comparison can be done against org.json, as it doesn't 
offer any sort of object binding facility.

i've attached the test harness i used.

Original issue reported on code.google.com by jeffrey.blattman@gmail.com on 31 Oct 2011 at 7:30

Attachments:

GoogleCodeExporter commented 9 years ago
Have you tried the latest GSON from SVN? It's faster.

Original comment by jessewil...@google.com on 1 Nov 2011 at 1:46

GoogleCodeExporter commented 9 years ago
I spent some time on this tonight and I isolated the problem. Our map type 
adapter is doing a lot more work than it needs to when converting a property 
name into a map key. I'll have a fix soon.

Original comment by limpbizkit on 25 Nov 2011 at 5:25

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 25 Nov 2011 at 5:25

GoogleCodeExporter commented 9 years ago
On today's numbers the comparison is much more favorable. After disabling 
pretty printing we get this:
  "GSON test" took 9495ms
  "org.json test" took 13162ms
  "Jackson test" took 4943ms
(Pretty printing adds about 30%).

Original comment by limpbizkit on 13 Dec 2011 at 4:33