Currently, I'm creating a JSON object that includes multiple addresses. My main concern is the potential for the JSON size to grow too large, which could impact browser performance and parsing speed in JavaScript. Each address includes keys such as "ID", "FirmName", "Address1", "Address2", "City", "State", "Zip5", and "Zip4". Having these repeated keys for each address significantly increases the overall json size.
I'm exploring ways to avoid the need for these repetitive keys in the JSON while still including their corresponding values for each address. Would representing the values of "ID", "Firmname", etc as an array [e.g., ["0","firmname","address1here",..] raise concerns about the order of the values?
Could representing them as an array of values (rather than multiple key-value pairs) make the parsing process more complex?
If I opt to directly represent it as an array of values to improve JSON efficiency, would this compromise the structure's readability?
"Address": [ { "-ID": "0", "FirmName": "firmname", "Address1": "address1here", "Address2": "13 infinite loop", "City": "new york", "State": "NY", "Zip5": "zip5here", "Zip4": "zip4here" }, { "-ID": "1", "FirmName": "firmhere", "Address1": "address1here", "Address2": "1 Smith Ct ", "City": "San Predo", "State": "CA", "Zip5": "ziphere", "Zip4": "ziphere1" }, { "-ID": "1", "FirmName": "firmhere", "Address1": "address1here", "Address2": "12 John Rd ", "City": "Newark", "State": "PA", "Zip5": "ziphere", "Zip4": "ziphere1" } ]
Your insights on this matter would be greatly appreciated.