In the spirit of these two questions:
- Is it worth the effort to try to reduce JSON size?
- JSON response objects: "pretty" keys and larger response or short keys and smaller response?
How does a browser handle large arrays of the same object-types, are their keynames somehow compressed in memory? I once used a graphics library and got a performance gain by shortening the key names of the objects, and so I am kind of stuck to that mind set. It seems though that it would not make a difference if I used an array of 1,000,000 such objects:
[{
"firstNameAsWrittenInID": Pete,
"lastNameAsWrittenInID": Jenkins
},{
"firstNameAsWrittenInID": Jane,
"lastNameAsWrittenInID": Jenkins
},
...
{
"firstNameAsWrittenInID": Johann,
"lastNameAsWrittenInID": Abele
}]
or an array of 1,000,000 of such objects:
[{
"f": Pete,
"l": Jenkins
},{
"f": Jane,
"l": Jenkins
},
...
{
"f": Johann,
"l": Abele
}]
Although it would seem that the first should use about twice the memory due to it's long key-names?