Reputation: 24325
I have a large JSON object of about 8 MB from a server stored in a browser client. If I cut down the name of variables that are duplicated in these lists will that give a performance boost at all when manipulating the lists and updating the objects?
{ "VenueLocationID" : 12 }
{ "vid" : 12 }
Upvotes: 1
Views: 1788
Reputation: 1147
If you're transferring 8MB of data from server to client, probably. However, there are better ways to improve performance. If your JSON is coming through an HTTP response, activating gzip compression could net even better performance without reducing readability.
The best way to tune performance is to profile the application -- find out where the bottlenecks are, then address them. Profilers can sometimes find things that I never thought would be issues.
Another thing to look at is how the JSON is being built. I've helped some systems out by stream-parsing. Instead of serializing (stringifying) one huge array, I serialized each element [and wrote it to a response stream,] surrounded by the typical delimiters ('['
, ']'
, and ','
).
Upvotes: 2