Any option to profile JIT code with Instruments?

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

Replies

Hi Lyve,

we currently don't have a way to map JIT compiled code back to symbols and source code when profiling with Instruments. I'm not aware of other tools to do so on AS either. Could you file a Feedback describing your use case? This will help us prioritize functionality like this.

  • The community of the Julia programming language is very interested in this. Julia is a JIT language with a large user base working on numerical computing, for whom performance is key. Currently, we have the same problem: Instruments only shows the addresses of the JIT-compiled functions.

    There is more information about this in https://github.com/JuliaLang/julia/issues/36446

Add a Comment

You could try asking the WebKit folks about this. They spend a lot of time optimising JITed code [1] and might be able to share some of their insights.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] I found this blog post fascinating.