Skip to content

Commit 6d287c5

Browse files
authored
Merge pull request ReactiveX#1493 from sue71/fix/improve-performance-subscribe
Fix bad performance caused by stacktrace
2 parents 0f5039e + deca593 commit 6d287c5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

RxSwift/ObservableType+Extensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extension ObservableType {
5050

5151
let synchronizationTracker = SynchronizationTracker()
5252

53-
let callStack = Thread.callStackSymbols
53+
let callStack = Hooks.recordCallStackOnError ? Thread.callStackSymbols : []
5454

5555
let observer = AnonymousObserver<E> { event in
5656

RxSwift/Rx.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,8 @@ func decrementChecked(_ i: inout Int) throws -> Int {
135135

136136
/// RxSwift global hooks
137137
public enum Hooks {
138+
139+
// Should capture call stack
140+
public static var recordCallStackOnError: Bool = false
138141

139142
}

0 commit comments

Comments
 (0)