Created
October 10, 2013 15:54
-
-
Save michaeldwan/6920745 to your computer and use it in GitHub Desktop.
Revisions
-
michaeldwan created this gist
Oct 10, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ NSData *data = [NSKeyedArchiver archivedDataWithRootObject:entry]; NSLog(@"%@", data); NSLog(@"Uncompressed: %d", [data length]); double start; start = [NSDate timeIntervalSinceReferenceDate]; for (int x = 0; x < 50000; x++) { [[data zlibDeflate] length]; } NSLog(@"z took %f seconds", [NSDate timeIntervalSinceReferenceDate] - start); start = [NSDate timeIntervalSinceReferenceDate]; for (int x = 0; x < 50000; x++) { [[data gzipDeflate] length]; } NSLog(@"gz took %f seconds", [NSDate timeIntervalSinceReferenceDate] - start); NSLog(@"zlib Compressed: %d", [[data zlibDeflate] length]); NSLog(@"gzip Compressed: %d", [[data gzipDeflate] length]); id decoded = [NSKeyedUnarchiver unarchiveObjectWithData:data]