Skip to content

Instantly share code, notes, and snippets.

@sdarlington
Created December 23, 2015 20:46
Show Gist options
  • Save sdarlington/9cd147f2c240f8a953e3 to your computer and use it in GitHub Desktop.
Save sdarlington/9cd147f2c240f8a953e3 to your computer and use it in GitHub Desktop.
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
@ZevEisenberg
Copy link

@sdarlington can you put it in another Swift file in the playground?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment