Has anyone else created a macOS SwiftUI app that uses a Table with a largish (~1000) number of entries? My app works OK at about 100 entries, but slows down as the number of entries increase. How slow? An instrumented test with 1219 entries shows a Hang of over 13 seconds from simply clicking/selecting an item in the table.
Instruments says the time is mostly spent in _CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION. Digging deeper I see AG::Subgraph::update(unsigned int) and descendants account for about half of the hang time.
My app is using @Observable on macOS 14 and is being tested on an M2 Max Studio.
There are other reported hangs. All seem to be in Swift/SwiftUI code.
Instruments
RSS for tagInstruments is a performance-analysis and testing tool for iOS, iPadOS, watchOS, tvOS, and macOS apps.
Posts under Instruments tag
90 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Instruments CPU Profiler failed to start the profilable app (get-task-allow is set to true) with error "No PMI Record Found". Device is iPhone 13 Pro currently running iOS 17.0.3. Tried to profile in instruments shipped with Xcode 14.3.1, Xcode 15.0.1 and Xcode 15.1 Beta, same issue across. If it helps, I was able to successfully profile on iPhone X running iOS f16.7 using Xcode 14.2 instruments.
I just downloaded Xcode 15 RC and iOS 17 RC on an iPhone Xr. When running the app it seems to run fine however when trying to run in profile mode I get the error:
Failed to install embedded profile for com...* : 0xe800801f (Attempted to install a Beta profile without the proper entitlement.)
Verify that the Developer App certificate for your account is trusted on your device. Open Settings on the device and navigate to General -> VPN & Device Management, then select your Developer App certificate to trust it.
Does anyone have any insight into what the issue may be? There is nothing to select within VPN & Device Management when I navigate there
Hello, I am trying to debug Swift Concurrency codes by using Swift Concurrency Instruments.
But in our project which has been maintained for a long time, Swift Concurrency Instruments seems not working.
Task {
print("async code")
await someAsyncFunction()
}
When I run Swift Concurrency Instruments with the above codes in our project, I could check that the print works well by checking stdout/stderr Instruments, but there are no records on Swift Concurrency Instruments.
But in the small simple sample project, I checked that Swift Concurrency Instruments works well.
Are there any settings that I need to do for the legacy project to debug Swift Concurrency?
I have a performance issue with a Mac SwiftUI app. Using instruments I see hangs reported. When I zero in on a hang I see that the time profiler reports most of the hang -- in one example 658 out of 687 ms -- being in 'static AppName.$main() [inlined]'.
I think that is saying my app is busy, but busy doing what?
The "hangs" are related to SwiftUI table processing. User experience is something like this: select an item, see the view changes based upon selection show up a second or two later. The duration of the hang increases with the number of items in the table. I'm testing with 100 ~ 1200 table entries.
Since version 14, Instruments cannot find the binary to show disassembly of executable or library.
It says: Error - Binary file for selected symbol is expected to be here: /Users/<user>/Library/Developer/Xcode/DerivedData/<project>/Build/Products/Release/<project>.
The thing is that the path shown by Instruments is actually the right one, and of course the binary exists in this directory.
Am I missing something somewhere ?
Hi, I use Xcode Instruments to Profile my app, but I don't know why Instruments can not find the right source code path, like the screensh ot shows, the path is wrong, what is ? it looks like a placeholder, is xcode forgetting to replace this placeholder with real file name?
anyone know how to fix this? thank you in advance
I want to test app launch performance in my project.
Therefore I tried to use performance test with measure func and XCTApplicationLaunchMetric. But after test completion there is no any result with average time.
Here is a test example:
func testLaunchPerformance() throws {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
}
But when I create a new empty project and add the same performance test – it works and shows app launch results.
1st image is a real project test – there is no test result.
and the 2nd image is a demo empty project test – it has performance result diagram.
I am running test on MacBook with M1 Pro chip. However, when my colleague is running the same performance test on our real project with Intel based MacBook Pro – all is fine, it shows app launch results correctly as my demo project.
I have no idea how it can be fixed, because it seems that it depends on M1 chip 🤷🏻♂️.
May be somebody have a solution?
When trying to profile any process with the Instruments CPU Profiler I get this message:
(Before run started) No allocated PMI record.
Not sure what to do here. I tried other instruments like time profile and that works fine so not sure what to do here... Didn't find any people having similar issues when googling so I'm hoping someone here can help me out.
Im using a m1 max 14 inch macbook pro with macOS 12.3 and instruments 13.0 (13A1030d)
Does the new HTTP Traffic instrument require iOS15 running on the device? I am attempting to profile my app and I get an error saying 'This device is lacking a required capability'?