{"action":"created","issue":{"url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2521","labels_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2521/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2521/comments","events_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2521/events","html_url":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2521","id":113952208,"number":2521,"title":"refactored and re-implemented combineLatest() to use a single OSSpinLock regardless of tuple size","user":{"login":"mishagray","id":303665,"avatar_url":"https://avatars.githubusercontent.com/u/303665?v=3","gravatar_id":"","url":"https://api.github.com/users/mishagray","html_url":"https://github.com/mishagray","followers_url":"https://api.github.com/users/mishagray/followers","following_url":"https://api.github.com/users/mishagray/following{/other_user}","gists_url":"https://api.github.com/users/mishagray/gists{/gist_id}","starred_url":"https://api.github.com/users/mishagray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishagray/subscriptions","organizations_url":"https://api.github.com/users/mishagray/orgs","repos_url":"https://api.github.com/users/mishagray/repos","events_url":"https://api.github.com/users/mishagray/events{/privacy}","received_events_url":"https://api.github.com/users/mishagray/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-29T00:04:32Z","updated_at":"2015-10-29T13:52:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2521","html_url":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2521","diff_url":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2521.diff","patch_url":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2521.patch"},"body":"Added simple Tuple extensions for packing and unpacking Tuples into Arrays.\r\n    \r\ncompletely reimplemented  the combineLatest(signals : [Signal<Value,Error]) -> Signal<[Value],Error> to use a single array of values, and and a single spin lock, regardless of the number of elements in the array.   \r\n    \r\nNo more 'climbing' chain of   .combineLatest().combineLatestWith().map(repack) for each additional tuple size.\r\n\r\nOld Solution had  O(N) NSLocks, and copies of the 'latestValue' (where N = tuple or array size).\r\n\r\nNew solution uses a single array of latest Values, a single spin lock, a won't create a set of blocks that could overflow the stack.  O(1) stack depth!\r\n"},"comment":{"url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/comments/152185795","html_url":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2521#issuecomment-152185795","issue_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2521","id":152185795,"user":{"login":"neilpa","id":42419,"avatar_url":"https://avatars.githubusercontent.com/u/42419?v=3","gravatar_id":"","url":"https://api.github.com/users/neilpa","html_url":"https://github.com/neilpa","followers_url":"https://api.github.com/users/neilpa/followers","following_url":"https://api.github.com/users/neilpa/following{/other_user}","gists_url":"https://api.github.com/users/neilpa/gists{/gist_id}","starred_url":"https://api.github.com/users/neilpa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neilpa/subscriptions","organizations_url":"https://api.github.com/users/neilpa/orgs","repos_url":"https://api.github.com/users/neilpa/repos","events_url":"https://api.github.com/users/neilpa/events{/privacy}","received_events_url":"https://api.github.com/users/neilpa/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T13:52:40Z","updated_at":"2015-10-29T13:52:40Z","body":"I agree w/ @NachoSoto about the type erasure here. Instead we can define `combineLatestWith` as the 10-arity version with params 3-10 being optional. Then invert the lower arity overloads to be defined in terms of the higher ones.\r\n\r\nI started down this path at one point but there's a few difficulties to making this work. I never had a chance to finish it but I'll dig it up."}}