Skip to content

Commit 1287d62

Browse files
committed
Stop pessimizing print performance for no reason.
As pointed out in Ole Begeman's blog: https://oleb.net/blog/2016/09/playground-print-hook/ The playground print hook is being initialized a a non-null noop hook, which causes the fast paths in the print functions to be unused, and forcing the creation of a tee stream for things that have nothing to do with playgrounds. It is sad that no one noticed this...
1 parent 296ecf2 commit 1287d62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/core/OutputStream.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ extension Unicode.Scalar : TextOutputStreamable {
621621
}
622622

623623
/// A hook for playgrounds to print through.
624-
public var _playgroundPrintHook : ((String) -> Void)? = {_ in () }
624+
public var _playgroundPrintHook : ((String) -> Void)? = nil
625625

626626
@_fixed_layout // FIXME(sil-serialize-all)
627627
@_versioned // FIXME(sil-serialize-all)

0 commit comments

Comments
 (0)