Skip to content
Browse files

Added results UI

  • Loading branch information...
1 parent 134bba3 commit 57571c313f27145e316778c31ba70f28525bc5f6 @soffes soffes committed Sep 12, 2010
View
4 Classes/JBAppDelegate.h
@@ -8,6 +8,10 @@
@interface JBAppDelegate : UIView <UIApplicationDelegate> {
+ UIWindow *_window;
+ UINavigationController *_navigationController;
}
+- (void)benchmark;
+
@end
View
215 Classes/JBAppDelegate.m
@@ -7,29 +7,36 @@
//
#import "JBAppDelegate.h"
-
-// TouchJSON
-#import "CJSONDeserializer.h"
-#import "CJSONSerializer.h"
-
-// JSON Framework
+#import "JBResultsViewController.h"
+#import "JBConstants.h"
+#import "JSONParser.h"
+#import "JSONWriter.h"
#import "SBJsonParser.h"
#import "SBJsonWriter.h"
-
-// YAJL
+#import "JSONKit.h"
+#import "CJSONDeserializer.h"
+#import "CJSONSerializer.h"
#import "NSObject+YAJL.h"
-// JSONKit
-#import "JSONKit.h"
+// Comparer function for sorting
+static int _compareResults(NSDictionary *result1, NSDictionary *result2, void *context) {
+ return [[result1 objectForKey:JBAverageTimeKey] compare:[result2 objectForKey:JBAverageTimeKey]];
+}
-// Apple JSON
-#import "JSONParser.h"
-#import "JSONWriter.h"
@implementation JBAppDelegate
-- (void)applicationDidFinishLaunching:(UIApplication *)application {
-
+#pragma mark NSObject
+
+- (void)dealloc {
+ [_navigationController release];
+ [_window release];
+ [super dealloc];
+}
+
+#pragma mark Benchmarking
+
+- (void)benchmark {
// This could obviously be better, but I'm trying to keep things simple.
// Configuration
@@ -44,35 +51,35 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
NSArray *array = (NSArray *)[[CJSONDeserializer deserializer] deserialize:jsonData error:nil];
NSUInteger x = 0;
- // Read with TouchJSON
- NSTimeInterval touchJSONReadTotal = 0.0;
- CJSONDeserializer *parser = [CJSONDeserializer deserializer];
+ // Read with Apple JSON
+ NSTimeInterval appleJSONReadTotal = 0.0;
for (x = 0; x < times; x++) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDate *before = [NSDate date];
- id object = [parser deserialize:jsonData error:nil];
+ id object = [JSON objectWithData:jsonData options:0 error:nil];
NSDate *after = [NSDate date];
NSTimeInterval time = [after timeIntervalSinceDate:before];
- touchJSONReadTotal += time;
+ appleJSONReadTotal += time;
[object description]; // Eliminate warning
[pool release];
}
- NSLog(@"TouchJSON average read time: %f", (touchJSONReadTotal / times));
+ NSTimeInterval appleJSONReadAverage = (appleJSONReadTotal / times);
+ NSLog(@"Apple JSON average read time: %f", appleJSONReadAverage);
- // Write with TouchJSON
- NSTimeInterval touchJSONWriteTotal = 0.0;
- CJSONSerializer *writer = [CJSONSerializer serializer];
+ // Write with Apple JSON
+ NSTimeInterval appleJSONWriteTotal = 0.0;
for (x = 0; x < times; x++) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDate *before = [NSDate date];
- NSString *writtenString = [writer serializeArray:array error:nil];
+ NSString *writtenString = [JSON stringWithObject:array options:0 error:nil];
NSDate *after = [NSDate date];
NSTimeInterval time = [after timeIntervalSinceDate:before];
- touchJSONWriteTotal += time;
+ appleJSONWriteTotal += time;
[writtenString description]; // Eliminate warning
[pool release];
}
- NSLog(@"TouchJSON average write time: %f", (touchJSONWriteTotal / times));
+ NSTimeInterval appleJSONWriteAverage = (appleJSONWriteTotal / times);
+ NSLog(@"Apple JSON average write time: %f", appleJSONWriteAverage);
// Read with JSON Framework
NSTimeInterval jsonFrameworkReadTotal = 0.0;
@@ -87,7 +94,8 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
[object description]; // Eliminate warning
[pool release];
}
- NSLog(@"JSON Framework average read time: %f", (jsonFrameworkReadTotal / times));
+ NSTimeInterval jsonFrameworkReadAverage = (jsonFrameworkReadTotal / times);
+ NSLog(@"JSON Framework average read time: %f", jsonFrameworkReadAverage);
// Write with JSON Framework
NSTimeInterval jsonFrameworkWriteTotal = 0.0;
@@ -102,96 +110,177 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
[writtenString description]; // Eliminate warning
[pool release];
}
- NSLog(@"JSON Framework average write time: %f", (jsonFrameworkWriteTotal / times));
+ NSTimeInterval jsonFrameworkWriteAverage = (jsonFrameworkWriteTotal / times);
+ NSLog(@"JSON Framework average write time: %f", jsonFrameworkWriteAverage);
- // Read with YAJL
- NSTimeInterval yajlReadTotal = 0.0;
+ // Read with JSONKit
+ NSTimeInterval jsonKitReadTotal = 0.0;
+ JSONDecoder *jsonKitDecoder = [JSONDecoder decoder];
for (x = 0; x < times; x++) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDate *before = [NSDate date];
- id object = [jsonString yajl_JSON];
+ id object = [jsonKitDecoder parseJSONData:jsonData];
NSDate *after = [NSDate date];
NSTimeInterval time = [after timeIntervalSinceDate:before];
- yajlReadTotal += time;
+ jsonKitReadTotal += time;
[object description]; // Eliminate warning
[pool release];
}
- NSLog(@"YAJL average read time: %f", (yajlReadTotal / times));
+ NSTimeInterval jsonKitReadAverage = (jsonKitReadTotal / times);
+ NSLog(@"JSONKit average read time: %f", jsonKitReadAverage);
- // Write with YAJL
- NSTimeInterval yajlWriteTotal = 0.0;
+ // Write with JSONKit
+ NSTimeInterval jsonKitWriteTotal = 0.0;
for (x = 0; x < times; x++) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDate *before = [NSDate date];
- NSString *writtenString = [array yajl_JSONString];
+ NSString *writtenString = [array JSONString];
NSDate *after = [NSDate date];
NSTimeInterval time = [after timeIntervalSinceDate:before];
- yajlWriteTotal += time;
+ jsonKitWriteTotal += time;
[writtenString description]; // Eliminate warning
[pool release];
}
- NSLog(@"YAJL average write time: %f", (yajlWriteTotal / times));
+ NSTimeInterval jsonKitWriteAverage = (jsonKitWriteTotal / times);
+ NSLog(@"JSONKit average write time: %f", jsonKitWriteAverage);
- // Read with JSONKit
- NSTimeInterval jsonKitReadTotal = 0.0;
- JSONDecoder *jsonKitDecoder = [JSONDecoder decoder];
+ // Read with TouchJSON
+ NSTimeInterval touchJSONReadTotal = 0.0;
+ CJSONDeserializer *parser = [CJSONDeserializer deserializer];
for (x = 0; x < times; x++) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDate *before = [NSDate date];
- id object = [jsonKitDecoder parseJSONData:jsonData];
+ id object = [parser deserialize:jsonData error:nil];
NSDate *after = [NSDate date];
NSTimeInterval time = [after timeIntervalSinceDate:before];
- jsonKitReadTotal += time;
+ touchJSONReadTotal += time;
[object description]; // Eliminate warning
[pool release];
}
- NSLog(@"JSONKit average read time: %f", (jsonKitReadTotal / times));
+ NSTimeInterval touchJSONReadAverage = (touchJSONReadTotal / times);
+ NSLog(@"TouchJSON average read time: %f", touchJSONReadAverage);
- // Write with JSONKit
- NSTimeInterval jsonKitWriteTotal = 0.0;
+ // Write with TouchJSON
+ NSTimeInterval touchJSONWriteTotal = 0.0;
+ CJSONSerializer *writer = [CJSONSerializer serializer];
for (x = 0; x < times; x++) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDate *before = [NSDate date];
- NSString *writtenString = [array JSONString];
+ NSString *writtenString = [writer serializeArray:array error:nil];
NSDate *after = [NSDate date];
NSTimeInterval time = [after timeIntervalSinceDate:before];
- jsonKitWriteTotal += time;
+ touchJSONWriteTotal += time;
[writtenString description]; // Eliminate warning
[pool release];
}
- NSLog(@"JSONKit average write time: %f", (jsonKitWriteTotal / times));
+ NSTimeInterval touchJSONWriteAverage = (touchJSONWriteTotal / times);
+ NSLog(@"TouchJSON average write time: %f", touchJSONWriteAverage);
- // Read with Apple JSON
- NSTimeInterval appleJSONReadTotal = 0.0;
+ // Read with YAJL
+ NSTimeInterval yajlReadTotal = 0.0;
for (x = 0; x < times; x++) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDate *before = [NSDate date];
- id object = [JSON objectWithData:jsonData options:0 error:nil];
+ id object = [jsonString yajl_JSON];
NSDate *after = [NSDate date];
NSTimeInterval time = [after timeIntervalSinceDate:before];
- appleJSONReadTotal += time;
+ yajlReadTotal += time;
[object description]; // Eliminate warning
[pool release];
}
- NSLog(@"Apple JSON average read time: %f", (appleJSONReadTotal / times));
+ NSTimeInterval yajlReadAverage = (yajlReadTotal / times);
+ NSLog(@"YAJL average read time: %f", yajlReadAverage);
- // Write with Apple JSON
- NSTimeInterval appleJSONWriteTotal = 0.0;
+ // Write with YAJL
+ NSTimeInterval yajlWriteTotal = 0.0;
for (x = 0; x < times; x++) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDate *before = [NSDate date];
- NSString *writtenString = [JSON stringWithObject:array options:0 error:nil];
+ NSString *writtenString = [array yajl_JSONString];
NSDate *after = [NSDate date];
NSTimeInterval time = [after timeIntervalSinceDate:before];
- appleJSONWriteTotal += time;
+ yajlWriteTotal += time;
[writtenString description]; // Eliminate warning
[pool release];
}
- NSLog(@"Apple JSON average write time: %f", (appleJSONWriteTotal / times));
+ NSTimeInterval yajlWriteAverage = (yajlWriteTotal / times);
+ NSLog(@"YAJL average write time: %f", yajlWriteAverage);
+
+ // Done. Construct results
+ NSMutableArray *readingResults = [[NSMutableArray alloc] initWithObjects:
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"Apple JSON", JBLibraryKey,
+ [NSNumber numberWithDouble:appleJSONReadAverage], JBAverageTimeKey,
+ nil],
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"JSON Framework", JBLibraryKey,
+ [NSNumber numberWithDouble:jsonFrameworkReadAverage], JBAverageTimeKey,
+ nil],
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"JSONKit", JBLibraryKey,
+ [NSNumber numberWithDouble:jsonKitReadAverage], JBAverageTimeKey,
+ nil],
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"TouchJSON", JBLibraryKey,
+ [NSNumber numberWithDouble:touchJSONReadAverage], JBAverageTimeKey,
+ nil],
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"YAJL", JBLibraryKey,
+ [NSNumber numberWithDouble:yajlReadAverage], JBAverageTimeKey,
+ nil],
+ nil];
+ [readingResults sortUsingFunction:_compareResults context:nil];
+
+ NSMutableArray *writingResults = [[NSMutableArray alloc] initWithObjects:
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"Apple JSON", JBLibraryKey,
+ [NSNumber numberWithDouble:appleJSONWriteAverage], JBAverageTimeKey,
+ nil],
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"JSON Framework", JBLibraryKey,
+ [NSNumber numberWithDouble:jsonFrameworkWriteAverage], JBAverageTimeKey,
+ nil],
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"JSONKit", JBLibraryKey,
+ [NSNumber numberWithDouble:jsonKitWriteAverage], JBAverageTimeKey,
+ nil],
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"TouchJSON", JBLibraryKey,
+ [NSNumber numberWithDouble:touchJSONWriteAverage], JBAverageTimeKey,
+ nil],
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ @"YAJL", JBLibraryKey,
+ [NSNumber numberWithDouble:yajlWriteAverage], JBAverageTimeKey,
+ nil],
+ nil];
+ [writingResults sortUsingFunction:_compareResults context:nil];
+
+ NSDictionary *allResults = [[NSDictionary alloc] initWithObjectsAndKeys:
+ readingResults, JBReadingKey,
+ writingResults, JBWritingKey,
+ nil];
+ [[NSNotificationCenter defaultCenter] postNotificationName:JBDidFinishBenchmarksNotification object:allResults];
+
+ [readingResults release];
+ [writingResults release];
+ [allResults release];
+}
+
+
+#pragma mark UIApplicationDelegate
+
+- (void)applicationDidFinishLaunching:(UIApplication *)application {
+
+ // Setup UI
+ _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ JBResultsViewController *viewController = [[JBResultsViewController alloc] init];
+ _navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
+ [viewController release];
+ [_window addSubview:_navigationController.view];
+ [_window makeKeyAndVisible];
- // Done
- NSLog(@"Done. Quitting...");
- abort();
+ // Perform after delay so UI doesn't block
+ [self performSelector:@selector(benchmark) withObject:nil afterDelay:0.1];
}
@end
View
16 Classes/JBResultsViewController.h
@@ -0,0 +1,16 @@
+//
+// JBResultsViewController.h
+// JSONBenchmarks
+//
+// Created by Sam Soffes on 9/12/10.
+// Copyright 2010 Sam Soffes. All rights reserved.
+//
+
+@interface JBResultsViewController : UITableViewController {
+
+ UISegmentedControl *_segmentedControl;
+ NSDictionary *_allResults;
+ BOOL _reading;
+}
+
+@end
View
101 Classes/JBResultsViewController.m
@@ -0,0 +1,101 @@
+//
+// JBResultsViewController.m
+// JSONBenchmarks
+//
+// Created by Sam Soffes on 9/12/10.
+// Copyright 2010 Sam Soffes. All rights reserved.
+//
+
+#import "JBResultsViewController.h"
+#import "JBConstants.h"
+
+@interface JBResultsViewController (PrivateMethods)
+- (void)_didFinishBenchmarks:(NSNotification *)notification;
+- (NSArray *)_results;
+@end
+
+
+@implementation JBResultsViewController
+
+#pragma mark NSObject
+
+- (id)init {
+ if ((self = [super initWithStyle:UITableViewStyleGrouped])) {
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didFinishBenchmarks:) name:JBDidFinishBenchmarksNotification object:nil];
+ }
+ return self;
+}
+
+
+- (void)dealloc {
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [_segmentedControl release];
+ [_allResults release];
+ [super dealloc];
+}
+
+
+#pragma mark UIViewController
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ _reading = YES;
+
+ NSArray *items = [[NSArray alloc] initWithObjects:@"Reading", @"Writing", nil];
+ _segmentedControl = [[UISegmentedControl alloc] initWithItems:items];
+ _segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
+ _segmentedControl.selectedSegmentIndex = 0;
+ _segmentedControl.frame = CGRectMake(0.0, 0.0, 280.0, 32.0);
+ [_segmentedControl addTarget:self.tableView action:@selector(reloadData) forControlEvents:UIControlEventValueChanged];
+
+ self.navigationItem.titleView = _segmentedControl;
+
+ [items release];
+}
+
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
+ return YES;
+ }
+ return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
+}
+
+
+#pragma mark Private Methods
+
+- (void)_didFinishBenchmarks:(NSNotification *)notification {
+ [_allResults release];
+ _allResults = [[notification object] retain];
+ [self.tableView reloadData];
+}
+
+- (NSArray *)_results {
+ return [_allResults objectForKey:((_segmentedControl.selectedSegmentIndex == 0) ? JBReadingKey : JBWritingKey)];
+}
+
+
+#pragma mark UITableViewDataSource
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+ return [[self _results] count];
+}
+
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+ static NSString *cellIdentifier = @"cellIdentifier";
+
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
+ if (cell == nil) {
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier] autorelease];
+ }
+
+ NSDictionary *result = [[self _results] objectAtIndex:indexPath.row];
+ cell.textLabel.text = [result objectForKey:JBLibraryKey];
+ cell.detailTextLabel.text = [NSString stringWithFormat:@"%.08f seconds", [[result objectForKey:JBAverageTimeKey] floatValue]];
+
+ return cell;
+}
+
+@end
View
14 JSONBenchmarks.xcodeproj/project.pbxproj
@@ -10,6 +10,8 @@
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; };
+ B20294AF123C9D4500D64200 /* JBResultsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B20294AE123C9D4500D64200 /* JBResultsViewController.m */; };
+ B20294C2123CA12A00D64200 /* JBConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = B20294C1123CA12A00D64200 /* JBConstants.m */; };
B213445410A0BA690001FE31 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B213445110A0BA690001FE31 /* main.m */; };
B2457E8410A164A400BD3540 /* twitter_public_timeline.json in Resources */ = {isa = PBXBuildFile; fileRef = B2457E8310A164A400BD3540 /* twitter_public_timeline.json */; };
B2457ED010A1671E00BD3540 /* JBAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B2457ECF10A1671E00BD3540 /* JBAppDelegate.m */; };
@@ -91,6 +93,10 @@
1D6058910D05DD3D006BFB54 /* JSONBenchmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JSONBenchmarks.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ B20294AD123C9D4500D64200 /* JBResultsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JBResultsViewController.h; sourceTree = "<group>"; };
+ B20294AE123C9D4500D64200 /* JBResultsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JBResultsViewController.m; sourceTree = "<group>"; };
+ B20294C0123CA12A00D64200 /* JBConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JBConstants.h; sourceTree = "<group>"; };
+ B20294C1123CA12A00D64200 /* JBConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JBConstants.m; sourceTree = "<group>"; };
B213445010A0BA690001FE31 /* JSONBenchmarks_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONBenchmarks_Prefix.pch; sourceTree = "<group>"; };
B213445110A0BA690001FE31 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
B213445310A0BA690001FE31 /* JSONBenchmarks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "JSONBenchmarks-Info.plist"; sourceTree = "<group>"; };
@@ -160,6 +166,8 @@
children = (
B2457ECE10A1671E00BD3540 /* JBAppDelegate.h */,
B2457ECF10A1671E00BD3540 /* JBAppDelegate.m */,
+ B20294AD123C9D4500D64200 /* JBResultsViewController.h */,
+ B20294AE123C9D4500D64200 /* JBResultsViewController.m */,
B2457E8510A164A800BD3540 /* Vendor */,
);
path = Classes;
@@ -201,6 +209,8 @@
children = (
B213445010A0BA690001FE31 /* JSONBenchmarks_Prefix.pch */,
B213445110A0BA690001FE31 /* main.m */,
+ B20294C0123CA12A00D64200 /* JBConstants.h */,
+ B20294C1123CA12A00D64200 /* JBConstants.m */,
);
path = "Other Sources";
sourceTree = "<group>";
@@ -472,6 +482,8 @@
B274982B123C91E000A2A9E0 /* CJSONSerializer.m in Sources */,
B274982C123C91E000A2A9E0 /* CSerializedJSONData.m in Sources */,
B2749907123C91F700A2A9E0 /* JSONKit.m in Sources */,
+ B20294AF123C9D4500D64200 /* JBResultsViewController.m in Sources */,
+ B20294C2123CA12A00D64200 /* JBConstants.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -511,6 +523,7 @@
);
PRODUCT_NAME = JSONBenchmarks;
SDKROOT = iphoneos3.2;
+ TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
@@ -537,6 +550,7 @@
);
PRODUCT_NAME = JSONBenchmarks;
SDKROOT = iphoneos3.2;
+ TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
View
21 Other Sources/JBConstants.h
@@ -0,0 +1,21 @@
+//
+// JBConstants.h
+// JSONBenchmarks
+//
+// Created by Sam Soffes on 9/12/10.
+// Copyright 2010 Sam Soffes. All rights reserved.
+//
+
+#ifndef JBCONSTANTS
+#define JBCONSTANTS
+
+// Notification names
+extern NSString *const JBDidFinishBenchmarksNotification;
+
+// Keys
+extern NSString *const JBReadingKey;
+extern NSString *const JBWritingKey;
+extern NSString *const JBLibraryKey;
+extern NSString *const JBAverageTimeKey;
+
+#endif
View
19 Other Sources/JBConstants.m
@@ -0,0 +1,19 @@
+//
+// JBConstants.m
+// JSONBenchmarks
+//
+// Created by Sam Soffes on 9/12/10.
+// Copyright 2010 Sam Soffes. All rights reserved.
+//
+
+#import "JBConstants.h"
+
+// Notification names
+NSString *const JBDidFinishBenchmarksNotification = @"JBDidFinishBenchmarksNotification";
+
+// Keys
+NSString *const JBReadingKey = @"reading";
+NSString *const JBWritingKey = @"writing";
+NSString *const JBLibraryKey = @"library";
+NSString *const JBAverageTimeKey = @"averageTime";
+

0 comments on commit 57571c3

Please sign in to comment.
Something went wrong with that request. Please try again.