Created
December 23, 2015 20:46
-
-
Save sdarlington/9cd147f2c240f8a953e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
// Is there a way to "turn off" the Playground on certain lines? Not the same as changing the | |
// compilation to "manual" -- it's not the compilation that takes the time. | |
struct SomeThing : Hashable { | |
let x : Int | |
// This line gets updated 22299 times... which takes forever despite showing nothing interesting! | |
var hashValue: Int { get { return x } } | |
} | |
func ==(lhs : SomeThing, rhs : SomeThing) -> Bool { | |
return lhs.x == rhs.x | |
} | |
var x : [SomeThing:Int] = [:] | |
for a in 1...10000 { | |
x[SomeThing(x: a)] = a | |
} | |
x.count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@sdarlington can you put it in another Swift file in the playground?