Re: Binary Plist generation very slow
Re: Binary Plist generation very slow
- Subject: Re: Binary Plist generation very slow
- From: Alexander Spohr <email@hidden>
- Date: Mon, 10 Dec 2012 15:43:42 +0100
Never use dicts or arrays as a hashtable’s keys!
I removed the uniquing of dicts, arrays and sets. I now use an int based hash table with object.hashCode() as the key. My binary property list generation is now faster than the string based version.
The test file is a 11MB string based property list, run over a 100 times each.
Duration: 15805ms NSPropertyListOpenStepFormat
Duration: 10084ms NSPropertyListBinaryFormat_v1_0
If java could provide the address of an object I would use that and unique the collections again. The address would be a nice hash key. Unfortunately you don’t get addresses in Java and the hashCode() of collections are unusable.
atze
Original file (contains lots of spaces):
-rw-r--r--@ 1 atze atze 11786993 9 Dez 18:35 3500Attacks.plist
Binary:
-rw-r--r-- 1 atze atze 1270690 10 Dez 15:39 3500Attacks.plistb
Reverse test to ensure both (string & binary) generate the same output (using tabs instead of spaces):
-rw-r--r-- 1 atze atze 6819317 10 Dez 15:39 3500Attacks.plistx
-rw-r--r-- 1 atze atze 6819317 10 Dez 15:39 3500Attacks.plisty
Am 06.12.2012 um 11:16 schrieb Alexander Spohr <email@hidden>:
> Hi List,
>
> we tried to switch from string based plists to binary ones. The clients love it but it almost kills the servers.
>
> The binary plist generation is 26 times slower (for my test case):
> Duration: 2881 ms NSPropertyListOpenStepFormat
> Duration: 75008 ms NSPropertyListBinaryFormat_v1_0
>
> Does anyone have a faster binary plist generator at hand before I try to roll my own?
>
> atze
_______________________________________________
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