Restkit 0.20.1

Blake Watters edited this page May 16, 2013 · 4 revisions

RestKit v0.20.1 Released

Released: May 15, 2013
Install via CocoaPods: pod 'RestKit', '~> 0.20.1'

We are very pleased to announce the immediate availability of RestKit 0.20.1. This release builds on strengths of RestKit 0.20.0 and includes numerous bugfixes and performance improvements.

Release Details

The full details of all features and fixes present in the release are available on Github…

Release Highlights

Concurrent Object Request Operations

RKObjectRequestOperation and RKManagedObjectRequestOperation are now concurrent NSOperation subclasses that no longer rely on blocking when executing sub-operations. This results in the use of less threads when there are a number of operations executing and avoids a deadlock situation when a managed object request was started from the main thread outside of an NSOperationQueue.

Performance Improvements

A major focus of this release was on performance. There were enhancements across the stack:

  1. A new performance optimization has been made available via the modificationKey attribute on RKEntityMapping. This property allows portions of the mapping process to be skipped if no changes have been made. A typical use-case is to designate the last updated timestamp of each record in a collection as the modification key. When this property is configured, the mapper will compare the existing value stored in Core Data with the inbound value being mapped and if they match, no further mapping is processed. For large payloads of objects with many properties beind mapped this can provide a dramatic speed-up.
  2. The in memory managed object caches have been reworked to perform as much of their work asynchronously as possible, increasing mapping performance.
  3. Numerous bottlenecks were eliminated through extensive profiling in instruments. In particular, the use of [NSString stringWithFormat:] was eliminated from the mapping engine Grand Central Dispatch was used to replace NSRecursiveLock within internal classes.
  4. The performance of RKRelationshipConnectionOperation (the operation responsible for establishing relationships between Core Data objects as described by RKConnectionDescription) was improved by increasing the granularity of the operation. There is now one operation executed per object instead of one operation per connected relationship.
  5. Search indexing performance was similarly enhanced by batching groups of indexing tasks into larger aggregate operations.

Caching and Duplicate Object Bug Fixes

There were several bugs reported against 0.20.0 surrounding the managed object caches and various concurrency scenarios. These race conditions could lead to the inappropriate creation of duplicate objects within Core Data. All known concurrency issues and duplicate object issues have been closed in 0.20.1 and additional test coverage has been added.

Dynamic Mapping & 304 (Not Modified) Bug Fixes

Several users reported problematic configurations when making use of several mapping features at the same time. In particular, the use of RKDynamicMapping could become problematic when combined with orphaned object deletion with certain entity types. It was also possible to run into trouble when combining object mapping that uses a mixture of NSObject and NSManagedObject instances when the remote backend returned a 304 (Not Modified) response. These issues have been fixed.

Enhanced Network Logging

Logging within the network component has been significantly enhanced. In addition to the normal HTTP details, the logger now reports the time spent during the HTTP request, object mapping, and the total operation time as well as the number of objects mapped from the response. The output looks like:

I restkit.network:RKObjectRequestOperation.m:243 GET 'http://127.0.0.1:5678/airports/37/amenities.json' (200 OK / 349 objects) [request=0.0070s mapping=0.8849s total=0.8944s]

Travis CI

RestKit now has public continuous integration hosted by Travis CI. You can check the build status at any time: https://travis-ci.org/RestKit/RestKit

Open Source Extractions

A fair critisim of RestKit is that is a monolithic framework that could be available as more atomized components. We're sympathetic to this perspective and have been identifying internal components that can be made available standalone with the same high quality documentation and test coverage of the parent library. During the RestKit 0.20.1 cycle, several components were developed outside of the main library and are available for non-integrated uses:

  1. TransitionKit - TransitionKit provides an elegant, block based DSL for implementing State Machines in Objective-C. It is fully documented, has extensive test coverage, and is used to implement the state management of RKObjectRequestOperation within RestKit.
  2. RakeUp - For some time RestKit has included a set of integrated Rake tasks for running a local testing server. These tasks have been extracted from the library and made available as a standalone Ruby gem.