Here is a normal Xcode project. When it runs, there will only be no more than 5 wakes per second on CPU. But when I created a class inherited by MTKView in this project, there would be more than 100 wakes per second on CPU, which may make my device hot.
Besides, I also find many possible ways to create unusual wakes on CPU. But I need more test.
Steps:
- Create a new Xcode project using Swift.
- Run the project and see the wakes using Xcode, expect less than 5.
- Add the following code in the project:
- Run the project and see the wakes using Xcode, expect more than 100.
import Foundation
import MetalKit
class MTKPlayerView : MTKView {
init() {
let dev = MTLCreateSystemDefaultDevice()!
super.init(frame: .zero, device: dev)
}
required init(coder: NSCoder) {
super.init(coder: coder)
}
}
I haven't find any information about this thread named gputools_smt_poll. If you know anything about it you can share with me.