Closed mgod closed 11 years ago
Minimize expensive calls in tight loops. This may not be worth accepting given the state of development on the sql calls right now. Tested by adding:
@property (nonatomic, readwrite) double doubleProperty;
to DecimalRecord and running this micro-benchmark:
it(@"should run some very basic performance tests", ^{ NSDecimalNumber *acc = [NSDecimalNumber one]; while (acc.floatValue < 10000) { DecimalRecord *record = [DecimalRecord newRecord]; record.decimal = acc; record.doubleProperty = acc.doubleValue; [record save]; acc = [acc decimalNumberByAdding:[NSDecimalNumber one]]; } for(int i = 0; i < 5; i++) { NSDate *start = [NSDate date]; [DecimalRecord allRecords]; NSLog(@"Time elapsed: %f", [[NSDate date] timeIntervalSinceDate:start]); } });
Thank you, @mgod.
Minimize expensive calls in tight loops. This may not be worth accepting given the state of development on the sql calls right now. Tested by adding:
to DecimalRecord and running this micro-benchmark: