samujjwal / google-gson

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

caching object keys #618

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Can a maintainer please check if the JSONObject keys are being cached while 
parsing strings?

I remember till two years ago the org.JSON library was duplicating all those 
keys in memory, instead of using a reference to a cached value. 

For example: 
[{"id": 1, "name": "rafa"}, {"id": 2, "name": "Silvia"}]

In that case, we should have only one copy of "id" and "name" in memory. 

If this array has 10000000 elements, the memory to allocate the field name is 
higher than the actual data.

thanks

Original issue reported on code.google.com by mufumb...@gmail.com on 31 Dec 2014 at 8:42