Jens Alfke
unread,Nov 5, 2012, 4:11:57 PM11/5/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mobile-c...@googlegroups.com
Here’s a summary of what’s gone into TouchDB’s ‘master’ [unstable] branch over the pst two weeks since b8:
• Yet another fix for pull replications — in fact, bringing back TDSocketChangeTracker. Reading the _changes feed has been a tale of woe, and mysteriously far more complex than it ought to be; this latest change should resolve problem when either (a) running five or more pull replications from the same server at once, or (b) pulling from a URL with a numeric IP address. This also allowed me to bump the number of parallel connections used by the puller, which significantly improves performance.
• An optimization for grouped/reduced view queries. TouchDB can now avoid having to parse the JSON of every key & value if the reduce function doesn’t use them, i.e. doesn’t access the items of either the ‘keys’ or the ‘values’ arrays.
• Converted the source code to ARC. This shouldn’t affect clients at all, but it’ll make development easier in the future.
These are all 1.0.1-type changes; nothing major, though they do need testing.
The big change coming up is that I’m merging CouchCocoa into TouchDB. This will make the combined code smaller, faster and simpler. Currently, CouchCocoa talks to TouchDB through a REST API, so everything has to get translated into an NSURLRequest and routed through CFNetwork and then parsed again:
app –> CouchDocument –> NSURLRequest –> CFNetwork –> TDURLProtocol –> TDRouter –> TDDatabase –> SQLite
After the merge there are a lot fewer layers:
app –> CouchDocument –> TDDatabase –> SQLite
I’m also changing the API to make it mostly synchronous. TouchDB is fast enough that it isn’t necessary to use an asynchronous programming model to work with it, just as you don’t typically use asynchronous code to read and write files. This makes the API simpler and shaves off more code size and complexity.
The gotcha is that the API isn’t exactly CouchCocoa anymore. For one thing, some method signatures have changed because they’re now synchronous. For another thing, its functionality is different because it no longer talks to remote CouchDB servers. I’ve thus renamed the classes: the prefix is now “Touch” instead of “Couch”, e.g. TouchDocument instead of CouchDocument. This will allow anyone who still needs remote-CouchDB functionality to link in the existing CouchCocoa as well without running into name conflicts.
I’ve been working on this off and on for a few months, and it’s not quite ready to see the light of day yet, but I hope to make it available really soon.
—Jens