Instruments

RSS for tag

Instruments is a performance-analysis and testing tool for iOS, iPadOS, watchOS, tvOS, and macOS apps.

Instruments Documentation

Posts under Instruments tag

84 Posts
Sort by:
Post not yet marked as solved
7 Replies
298 Views
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.
Posted
by marchyman.
Last updated
.
Post not yet marked as solved
1 Replies
112 Views
i have an apple m1 macbook pro. Recently I updated to the new Ventura 13.4 and afte the update my track pad refuses to be clicked, rebooted but the problem remains...
Posted Last updated
.
Post not yet marked as solved
1 Replies
117 Views
Dear Experts, Where do memory-mapped files appear in the Allocations instrument, if at all? In the screenshot below, the green "all anonymous VM" graph is almost completely explained by the purple "IO Accelerator" graph (GPU buffers, textures etc) - but there are periods at the start of each cycle (such as at the cursor position) where there is some other contribution. I have not been able to find this in the other more-specific graphs. Any ideas anyone? I have been trying to make this app better behaved memory-wise and have made a lot of progress, in particular by removing periods when two large memory allocations co-exist, and by breaking work up into chunks. It now bothers me that there is 150 MB of "anonymous VM" that I cannot explain!
Posted
by endecotp.
Last updated
.
Post not yet marked as solved
0 Replies
88 Views
We are facing the below mentioned error frequently while submitting the different apps in the App Store. When we are uploading the first build, we are receiving the below mentioned error and if we increment the build version, and on re submitting we are not facing the same issue again. Could you please guide us on what caused this issue? Xcode Version: 14.2 Error : ITMS-90338: Non-public API usage - The app contains one or more corrupted binaries. Rebuild the app and resubmit.. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed.
Posted Last updated
.
Post not yet marked as solved
4 Replies
1.5k Views
My watchOS app crashes when I accept/change the microphone or Bluetooth permission from its companion iOS app. It crashes with the following message in the console. Message from debugger: Terminated due to signal 9 Please let me know a way to identify and fix the exact problem. here are my device logs: Device logs and crash report
Posted Last updated
.
Post marked as solved
3 Replies
626 Views
As part of a hobby project, I'm working on a 2D game engine that will draw each pixel every frame, using a color from a palette. I am looking for a way to do that while maintaining a reasonable frame rate (60fps being the minimum). Without any game-logic in place, I am updating the values of my pixels with some value form the palette. I'm currently taking the mod of an index, to (hopefully) prevent the compiler from doing some loop-optimisation it could do with a fixed value. My very naive implementation of updating the bytes in the pixel array goes like this. On an iPhone 12 Pro, each run of updating all pixel values takes on average 43 ms, while on a simulator running on an M1 mac, it takes 15 ms. Both unacceptable, as that would leave not for any additional game logic (which would be much more operations than taking the mod of an Int). I was planning to look into Metal and set up a surface, but clearly the bottleneck here is the CPU, so if I can optimize this code, I could go for a higher-level framework. Any suggestions on a performant way to write this many bytes much, much faster (parallelisation is not an option)? struct BGRA { let blue: UInt8 let green: UInt8 let red: UInt8 let alpha: UInt8 } let BGRAPallet = [ BGRA(blue: 124, green: 124, red: 124, alpha: 0xff), BGRA(blue: 252, green: 0, red: 0, alpha: 0xff), // ... 62 more values in my code, omitting here for brevity ] private func test() { let pixelBufferPtr = UnsafeMutableBufferPointer<BGRA>.allocate(capacity: screenWidth * screenHeight) let runCount = 1000 let start = Date.now for _ in 0 ..< runCount { for index in 0 ..< pixelBufferPtr.count { pixelBufferPtr[index] = BGRAPallet[index % BGRAPallet.count] } } let elapsed = Date.now.timeIntervalSince(start) print("Average time per run: \((Int(elapsed) * 1000) / runCount) ms") }
Posted
by Joride.
Last updated
.
Post not yet marked as solved
5 Replies
269 Views
When using Instruments to capture FIXED_CYCLES and FIXED_INSTRUCTIONS on both an M1 based MacBook and also on an iPhone, the value of these counts is much higher when enabling High Frequency Sampling. Why is the count of Instructions and Cycles higher with Higher Frequency Sampling? Is it due to stack sampling overheads? Which is more accurate to capture FIXED_CYCLES and FIXED_INSTRUCTIONS counts - with High Frequency Sampling or without?
Posted
by GurjB.
Last updated
.
Post not yet marked as solved
3 Replies
454 Views
I am facing an issue trying to detect a memory leak for iOS project with any Simulator for iOS 16.1 on Xcode 14.1 I am working on an example app https://github.com/Showmax/automated-memory-leak-testing-ios That simply creates a memory leak using a strong delegation between Two classes The expectation: when using the memory debug graph I am expecting that Xcode will mark the instance of GeneratorViewController that have a leak as a leak. Behavior: It doesn't The same behavior is happing when I am using the instrument tool with the defaults Leaks template. I only see can see tons of leaks when I use Simulator iOS 14 which I am not sure why it's different. Can you please support? Thanks
Posted Last updated
.
Post not yet marked as solved
1 Replies
250 Views
I have a tool that generates thousands of signpost events a second. Unfortunately, when profiling earlier signposts appear to get lost over the course of the run because they are not persisted and the buffer for these runs out. How can I get these to persist? For reference, I've filed a feedback for this as FB12129526, and more context can be found (in meme form) here: https://federated.saagarjha.com/notice/AUm3AprLdVOnUPfiQy.
Posted
by ILikeTau.
Last updated
.
Post not yet marked as solved
2 Replies
243 Views
I am trying to debug my custom keyboard extension via xcode instruments, I am getting the allocated memory and memory leaks, but I cannot see the stack backtrace, which is quite frustrating as I can't know the exact place/code which is causing the issue. Please help if anyone knows how. to solve this.
Posted
by elitek2.
Last updated
.
Post marked as solved
1 Replies
208 Views
After recording a network request using the "HTTP Traffic" instrument, I don't see the disclosure triangle documented here. I'd expect to see something similar to this screenshot: Instead, my document's top-level track is missing the disclosure triangle: I'm launching Instruments from Xcode using a debug configuration with a development certificate. I'm using an instance of URLSession directly (no third-party libraries) and am creating a URLSessionDataTask to send the request. Is this a bug in Instruments? Or am I doing something dumb? Versions Instruments Version 14.3 (14E222b) iOS Version 16.3.1 (20D67) macOS Version 13.2.1 (22D68)
Posted Last updated
.
Post not yet marked as solved
2 Replies
220 Views
Hi, I would like to use the Instruments Time Profiler to profile code of an emulator project. The code is generated by a JIT compiler at runtime. Unfortunately, Instruments only displays an address and it cannot even display the disassembly of that dynamically generated code region. The solution for x86_64 is to use VTune on Windows, the VTune JIT Profiling API allows to specify code regions and give them a name (and even specify source code). Is there something like that for Instruments, too? Or any other alternatives to profile JIT code on Apple Silicon? Thanks a lot in advance! Lyve
Posted
by Lyve.
Last updated
.
Post not yet marked as solved
0 Replies
244 Views
I'm trying to ensure my watch app launches as quickly as possible. I'm using the @WKApplicationDelegateAdaptor because of needing to implement the BackgroundRefresh handlers. What I'm finding is that the time between the app calling the main init() and then the ExtensionDelegate calling applicationDidFinishLaunching is often > 2 seconds. I've tried using Instruments to profile the App launch but have never had any luck with the tool on a watch app. So I then created a blank project just with the elements needed to implement the same WKApplicationDelegateAdaptor and oslog calls, performance was the same... This is tested on WatchOS 9.5 & 9.5. This is on a Series 6 and Series 8 Apple Watch (FYI S6 == S7 == S8 for Apple Watch CPU performance) Interestingly, on the simulator, the time gap was less, more like 1 second between main init() and applicationDidFinishLaunching.... not sure why this would be this way. Anyway, for real world device usage, is this the best performance I can expect? Is there anything that can be done to improve this?
Posted Last updated
.
Post not yet marked as solved
1 Replies
518 Views
Hi, I have an application that uses Metal compute kernels to do image processing and it is not built as an Xcode project. Is there a tool to attach or launch a process to profile the scheduling and execution of Metal kernels similar to CUDA's Nsight Systems (or visual profiler)? I want to see the information like kernel execution sequence, duration, kernel names, thread group size, etc. Is that possible to do without an Xcode project? I tried the Instruments tool, but it didn't seem to show the labeled compute kernels. Thanks!
Posted
by randomx92.
Last updated
.
Post not yet marked as solved
1 Replies
1.5k Views
I'm trying to find memory leaks in my application with either Memory Graph or Inspector. I'm getting the following errors:Memory Graph - Unable to acquire required task portInspector Prompts for passwordError: Failed to attach to target processAn error occurred trying to capture Leaks data.Unable to acquire required task port ()The odd thing is that both work on initial execution of the target, but every subsequent launch triggers the above errors. (including after restarting xcode and after reboot).If I change my target name it works one time and then the errors start again. So the target name is being cached somewhere and causing subsequent testing with that name impossible.I'm running xCode 10.2 and Mac OS 10.14.4.Some more context and ugly work around. This is a swift server app and I'm using swift package manager to generate the xcode project. The following works and avoids the above errors, but it is a hassle.swift package generate-xcodeprojopen projName.xcodeprojbuild and runclick Debug Memory Graph button. App Stopped and Memory Graph displays fine. If I stop the app and run again then I get the above errors.stop the appchange the target name in Package.swiftswift package generate-xcodeprojopen projName.xcodeprojbuild and runMemory Graph works one time againrinse and repeatI've found that using Inspector exhibits the same behavior.Any help would be appreciated.Thanks,Dana
Posted Last updated
.
Post not yet marked as solved
1 Replies
260 Views
Instruments is not honouring the working directory that I have specified in the target. It invokes the executable with the specified argument, but the working directory is root! (). Needless to say this causes problems with my app. Changing the directory within the app doesn't work either. I have granted Instruments Full Disk Access rights within the Security and Privacy settings, but that makes no difference. As a workaround, I attach to the already running process, but I'd like to know if this is a bug or if there is a trick to do this. XCode 13.1 and macOS 12.0.1. Note that I had to codesign the executable to over come the "Failed to Get Authorization" error. See https://developer.apple.com/forums/thread/681687. Thanks, Stew
Posted Last updated
.
Post not yet marked as solved
0 Replies
259 Views
Hello, While using the App Launch template with xctrace, the launch time for my app is much longer than expected. While investigating, I saw 4 syscalls to mach_msg_trap from dyld that are causing a delay of 100-300ms: I would like to know if there's any way to improve the performance here, as this is adding around 1 second more to my measurements and I have been trying to find a solution. Thank you very much for your help!
Posted Last updated
.
Post not yet marked as solved
1 Replies
349 Views
Hello, I have 2 problems currently tied to instruments on xcode 14.2 The first one: i currently use macbook pro 13' with intel processor and a mac mini M1. i am doing some signpost logging to measure my app performance on certain app lifetime period. The logging code is currently working in Macbook pro with intell processor, showing time spans of the intended signpost record. But with the same code, i cannot see result when i run it on Mac mini M1. The second one: Is about the instument settings. In intel macbook, the instument settings have CPU tab where i can limit my CPU core used for instrumentation. But on mac mini M1, i don't see any CPU tab on instrument setting, is this expected? ---will edit later--- img: Intel result img: mac mini M1 result ---will edit later--- img: Intel instument settings img: M1 Instrument settings
Posted
by GGAdi.
Last updated
.