{"action":"created","issue":{"url":"https://api.github.com/repos/ReactiveX/RxSwift/issues/1565","repository_url":"https://api.github.com/repos/ReactiveX/RxSwift","labels_url":"https://api.github.com/repos/ReactiveX/RxSwift/issues/1565/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveX/RxSwift/issues/1565/comments","events_url":"https://api.github.com/repos/ReactiveX/RxSwift/issues/1565/events","html_url":"https://github.com/ReactiveX/RxSwift/pull/1565","id":295253043,"number":1565,"title":"Performance improvements in thread lock.","user":{"login":"ra1028","id":7347118,"avatar_url":"https://avatars2.githubusercontent.com/u/7347118?v=4","gravatar_id":"","url":"https://api.github.com/users/ra1028","html_url":"https://github.com/ra1028","followers_url":"https://api.github.com/users/ra1028/followers","following_url":"https://api.github.com/users/ra1028/following{/other_user}","gists_url":"https://api.github.com/users/ra1028/gists{/gist_id}","starred_url":"https://api.github.com/users/ra1028/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ra1028/subscriptions","organizations_url":"https://api.github.com/users/ra1028/orgs","repos_url":"https://api.github.com/users/ra1028/repos","events_url":"https://api.github.com/users/ra1028/events{/privacy}","received_events_url":"https://api.github.com/users/ra1028/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-02-07T18:56:03Z","updated_at":"2018-02-13T08:33:06Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/ReactiveX/RxSwift/pulls/1565","html_url":"https://github.com/ReactiveX/RxSwift/pull/1565","diff_url":"https://github.com/ReactiveX/RxSwift/pull/1565.diff","patch_url":"https://github.com/ReactiveX/RxSwift/pull/1565.patch"},"body":"RxSwift uses Foundation `NSRecursiveLock`, but it includes an implementation that is no needed.\r\nSee [here](https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/NSLock.swift) about it.\r\n\r\nIn FRP, thread lock is very frequently used.\r\nSo, can be expect drastic performance improvements by implementing that minimal using pthread mutex.\r\n\r\nThis is before and after of my benchmark results.\r\nIn the tests with the most impact, it has improved by more than **1 sec**.\r\nHave little effects in creation tests that don't involving much thread lock.\r\n\r\n<img src=https://user-images.githubusercontent.com/7347118/35934933-456a0d02-0c82-11e8-9e23-779f20ae7c9d.png width=500>\r\n\r\nIncidentally, I've removed the typealias of SpinLick that no longer needed."},"comment":{"url":"https://api.github.com/repos/ReactiveX/RxSwift/issues/comments/365186883","html_url":"https://github.com/ReactiveX/RxSwift/pull/1565#issuecomment-365186883","issue_url":"https://api.github.com/repos/ReactiveX/RxSwift/issues/1565","id":365186883,"user":{"login":"kzaher","id":1641148,"avatar_url":"https://avatars1.githubusercontent.com/u/1641148?v=4","gravatar_id":"","url":"https://api.github.com/users/kzaher","html_url":"https://github.com/kzaher","followers_url":"https://api.github.com/users/kzaher/followers","following_url":"https://api.github.com/users/kzaher/following{/other_user}","gists_url":"https://api.github.com/users/kzaher/gists{/gist_id}","starred_url":"https://api.github.com/users/kzaher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kzaher/subscriptions","organizations_url":"https://api.github.com/users/kzaher/orgs","repos_url":"https://api.github.com/users/kzaher/repos","events_url":"https://api.github.com/users/kzaher/events{/privacy}","received_events_url":"https://api.github.com/users/kzaher/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T08:33:06Z","updated_at":"2018-02-13T08:33:06Z","author_association":"MEMBER","body":"@ra1028 If you can squash everything into a single commit, we can put it in optimizations2 branch so we don't forget about this."}}
{"actor":{"display_login":"kzaher"}}