magicien / GLTFQuickLook

macOS QuickLook plugin for glTF files
MIT License
240 stars 9 forks source link

High CPU usage #2

Open sakrist opened 7 years ago

sakrist commented 7 years ago

I've tested plugin with samples from gltf khronos repository and I got QuickLook service running all the time at 50% of CPU, even if QuickLook already closed.

magicien commented 7 years ago

Thank you for your report! Do you remember which model you tried? Does it happen every time?

magicien commented 7 years ago

It happened to me either when I repeatedly opened and closed QuickLook. Each time I open a QuickLook window, the number of QuickLookUIService threads increases. It seems that QuickLook forgot to stop SceneKit threads.

I filed this bug to Apple Bug Reporter. I'll let you know when I get any response.

magicien commented 6 years ago

The bug report I had sent was marked as duplicate of 34946387. I couldn't find it at Open Radar, but I believe they are working on this problem.

sakrist commented 6 years ago

Does QuickLook has any API which notifies when it closed? Hm, check this one, it's has topic about thread safety. https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/Quicklook_Programming_Guide/Articles/QLImplementationOverview.html#//apple_ref/doc/uid/TP40005020-CH6-SW5

magicien commented 6 years ago

It's difficult to control the thread's life cycle, because the thread is produced by SceneKit.qlgenerator. What GLTFQuickLook does is to convert gltf data into scn data, and give back the data to QuickLook service. And SceneKit.qlgenerator will receive the data and show it.

The bug I reported is about showing QuickLook of scn files, and I think it's difficult to fix the problem from this plugin.