- Generate a profile of the code that is executed during app startup.
- Deploy the profile as part of the app.
At startup, the profile data is used to predict which methods will be needed so that they can be compiled beforehand on a separate core.
You must generate the profile by using the same version of the app that you plan to package the profile with, because any code changes can invalidate the profile. An invalid profile typically makes startup performance worse.
Note This feature resembles the multi-core JIT feature for desktop apps. For desktop apps you can turn on multi-core JIT for individual application domains by using the ProfileOptimization class (http://go.microsoft.com/fwlink/p/?LinkId=253476). This class is not available for Windows Store apps.
Generating and packaging profilesThe common language runtime (CLR) uses a file-based trigger to determine whether to generate multi-core JIT profile data for a Windows Store app. To generate a profile, follow these steps:
- Create a 0-byte trigger file that is named [StartupExe]_[AppId].profile.
- [StartupExe] is your app’s executable file name, without the .exe extension. For example, if your app’s executable is named “MyApplication.exe," use “MyApplication.” For WWA apps, use “WWAHost.”
- [AppId] is the identifier that is associated with the app entry point in the package manifest (Package.appxmanifest). For most apps, this will be “App,” but for apps that have multiple entry points, this may differ.
- Put the trigger file into the root folder of the Visual Studio project for your main executable, and set Build Action to Content in the file properties.
- Deploy your app by selecting Deploy Solution on the Build menu in Visual Studio.
- Start your app from the start screen.
- It's important to start your app without using a debugger, because that can add unnecessary code paths to the profile.
- You must run the app on a multi-core computer. Otherwise the profile will not be generated.
- After the app runs for 10 seconds, a profile is generated in C:\Users\[UserName]\AppData\Local\Packages\[PackageName]\AC. This profile will have the same name as the trigger file from step 1.
- Replace the trigger file in your Visual Studio project with the profile that is generated in step 5, and then create the final app package.
Important If you make any code changes to your app, you must re-generate the profile.
Article ID: 2715214 - Last Review: 15 May 2013 - Revision: 1