Stefan Johansson
22 years ago
Hi all,
just "for fun" I did some serialization performance tests.
Currently I'm using NSKeyedArchiver coupled with NSKeyedUnarchiver to
serialize/deserialize dictionaries and send them over a socket.
Today I tried the same, but with NSPropertyListSerialization instead
(using the methods dataFromPropertyList and propertyListFromData.
I serialized/deserialized 10000 dictionaries with both metods and the
execution time difference was staggering.
NSKeyedArchiver took about 8 seconds to serialize 10000 dictionaries.
NSPropertyListSerialization took less than 1.5 seconds!
I don't know the underlying mechanisms for NSPropertyListSerialization, so
I can't figure out if this is correct or what.
If it is, I'm going to switch over to NSPropertyListSerialization
immediately.
What I do to send it over the socket is basically write([nsData bytes]...)
and then create a NSData object on the other side with the recieved data
and deserialize it.
Any caveeats or the like when using NSPropertyListSerialization instead of
NSKeyedArchiver/NSKeyedUnArchiver in this manner?
Thanks in advance.
Cheers,
Stefan
This message has been scanned by F-Secure Anti-Virus for Microsoft
Exchange.
Confidentiality Notice:
The information contained in this message may be legally privileged and/or
confidential information. It is intended only for the recipient(s) named
above.
If the reader of this message is not an intended recipient, you are hereby
notified that any use, dissemination, distribution or copying of this
message is strictly prohibited.
If you have received this message in error, please notify us immediately
at once by replying to the sender and delete the original message.
just "for fun" I did some serialization performance tests.
Currently I'm using NSKeyedArchiver coupled with NSKeyedUnarchiver to
serialize/deserialize dictionaries and send them over a socket.
Today I tried the same, but with NSPropertyListSerialization instead
(using the methods dataFromPropertyList and propertyListFromData.
I serialized/deserialized 10000 dictionaries with both metods and the
execution time difference was staggering.
NSKeyedArchiver took about 8 seconds to serialize 10000 dictionaries.
NSPropertyListSerialization took less than 1.5 seconds!
I don't know the underlying mechanisms for NSPropertyListSerialization, so
I can't figure out if this is correct or what.
If it is, I'm going to switch over to NSPropertyListSerialization
immediately.
What I do to send it over the socket is basically write([nsData bytes]...)
and then create a NSData object on the other side with the recieved data
and deserialize it.
Any caveeats or the like when using NSPropertyListSerialization instead of
NSKeyedArchiver/NSKeyedUnArchiver in this manner?
Thanks in advance.
Cheers,
Stefan
This message has been scanned by F-Secure Anti-Virus for Microsoft
Exchange.
Confidentiality Notice:
The information contained in this message may be legally privileged and/or
confidential information. It is intended only for the recipient(s) named
above.
If the reader of this message is not an intended recipient, you are hereby
notified that any use, dissemination, distribution or copying of this
message is strictly prohibited.
If you have received this message in error, please notify us immediately
at once by replying to the sender and delete the original message.