Win a copy of Terraform in Action this week in the Cloud forum!

Colby Smith

Greenhorn
+ Follow
since Jan 13, 2016
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Colby Smith

I'm currently running into an issue with a project where the time to load the data is taking too long for users. The time it takes to grab the data from the database and send it over to the javascript is fast. The time it takes to process the data on the javascript end is not.

When sending data over, I concat values as such: ("value1|value2|value3||value1|value2|value3..."). Then in the script I split the array based on the deliminator, and I know that the first value is, lets say, the name of the state. Then I know the second value is the number of email opens in that state, etc. I was thinking of doing JSON, but since JSON is based on a key-value system, would that be more data? Since the data I would be sending would be something like: ("stateName{count: value2, stateLongName: value3}").

Is the way JSON parsed faster than concatinating values into a string, then using JavaScript's 'split()' function to split them up as arrays and looping through them?

Thanks for the help!
5 years ago