I have a question. If there are hundreds of thousands of attributes in my json object, will there be any problems with json?
ringa_lee2017-05-19 10:41:25
js should have no restrictions on it, but the performance of the computer is limited.
I actually tested it:
var obj={};
for(var i=0;i<80000000;i++){
obj[i]=i;
if(i%1000==0){
console.log(i);
}
}
My computer will crash when it reaches over 70 million.
The more complex the keys and values stored in the object, the smaller the number that can be accommodated.
But in actual application, you definitely can’t do it like this!
ringa_lee2017-05-19 10:41:25
... Then why do you use Json? It's hard to throw the data into the database and then use the backend to write a program to read the database. .
迷茫2017-05-19 10:41:25
Hundreds of thousands of properties. . . JSON itself does not have any restrictions on the number of attributes, but js processing may be very slow, or a single request may not be able to be accommodated through http transmission. . .
滿天的星座2017-05-19 10:41:25
The question is why do you put hundreds of thousands of attributes in a JSON. .