Mirgorod
Mirgorod

Reputation: 32713

Serialize vs. Json

Now i am creating Ajax app and i want to know what is better to connect server data with client.

Last time i used json but some time ago i hear that serialized data is faster.

Who know what is better?

Upvotes: 0

Views: 1141

Answers (2)

barudo
barudo

Reputation: 665

Probably you're comparing serialize (working similarly in PHP) and json on your client (a browser). There's a serialize function (similar to how PHP works) in jquery but no native unserialize. I suggest you work with json when communication is between your server and your client (ajax).

Upvotes: 0

Oded
Oded

Reputation: 499212

In general, a serialized binary representation will be smaller than a JSON representation of the same object (that in turn would be smaller than an XML representation).

In this regards, network transfers would be faster.

Upvotes: 3

Related Questions