• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Serializing collections
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Serializing collections


  • Subject: Serializing collections
  • From: Miguel Arroz <email@hidden>
  • Date: Thu, 7 Feb 2008 17:31:01 +0000

Hi!

I need to serialize some collection objects (NSDictionaries, NSSets, etc) to save them in the DB. I'm doing some performance tests based on the Chuck's book page 43 note.

I have tried with the NSPropertyListSerialization and java Serialized stuff (as instructed on the Apple's note http:// docs.info.apple.com/article.html?artnum=75173&coll=ap).

For serializing and unserializing the same dictionary 100000k times, I have:

NSData length: 667
String length: 326
Property list serialization took 12272 milisecs, average 0.12272 per dict.
NSData serialization took 49137 milisecs, average 0.49137 per dict.


  (Note average values are in milisecs/dict, not secs/dict.

  There is two things here that actually amazed me:

  1) String is shorter than binary by a factor of 2;
  2) String is a lot faster than binary.

  I admit I was expecting the opposite.

Facing this, I ask: string serialization is faster, shorter and human readable. Is there any dark reason why I should use binary serialization and not text?

  Yours

Miguel Arroz

Miguel Arroz
http://www.terminalapp.net
http://www.ipragma.com



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Serializing collections
      • From: Miguel Arroz <email@hidden>
    • Re: Serializing collections
      • From: Miguel Arroz <email@hidden>
  • Prev by Date: Re: How to fetch eo with a specific relationship
  • Next by Date: Re: Serializing collections
  • Previous by thread: Re: Wonder 4 and JAVA/WO versions
  • Next by thread: Re: Serializing collections
  • Index(es):
    • Date
    • Thread