## Snapshot comparisons overview |

| In JProfiler, you can save profiling data to disk, either with the save action in JProfiler's main window or with the offline profiling API To compare one or several of these snapshots, JProfiler offers a separate comparison window that you can access by Choosing `Compare multiple snapshots` from the Snapshots tab of the start center and clicking [OK]. If the current window is already used for a profiling session, you will be prompted whether a new frame should be opened, otherwise the current window will be exchanged with the snapshot comparison window. Choosing Session->Compare snapshots in new window from JProfiler's main menu. Menu and toolbar of the snapshot window are focused on snapshot comparisons, you can access all other parts of JProfiler from a snapshot window by choosing File->Show start center from the main menu or clicking on the corresponding toolbar button. This can be necessary if you close all other windows. File->New window opens a new JProfiler window with the start center displayed.

| Note: It is possible to create and export comparisons from the command line or an ant build file. This is especially useful for an automated quality assurance process.

| The snapshot window contains a snapshot selector at the left side that lets you configure the snapshots which are available for creating a comparison. Before you create a comparison, you have to add the involved snapshots to the snapshot selector. If you open the snapshot comparison window without having saved any snapshots during the current JProfiler session, you will be prompted to select snapshot files. The order of the snapshot files in the list is significant since all comparisons will assume that snapshots further down in the list have been recorded later. Note: Snapshots are always compared to other snapshots, if you wish to compare a snapshot to a currently running profiling session, please save a snapshot first. The saved snapshot will automatically be shown in the snapshot selector. The snapshot selector offers the following operations as toolbar buttons and context menu items: add a new snapshot file (`INS`). In the following file chooser select one or more `*.jps` files to add to the snapshot selector. New snapshots are always appended to the end of the list. sort snapshot files. In the following popup dialog, you can select whether to sort the snapshot files by creation time (i.e. the file modification time) or by name. Note that this is a one-time operation, new snapshots are always appended to the end of the list. open snapshot files. The selected snapshot files are opened in new windows, just like when you open them from the start center or with Session->Open snapshot from JProfiler's main menu. remove snapshot files (`DEL`). The currently selected snapshot files are removed from the snapshot selector. If any of the snapshot files to be removed are used in an existing comparison, those comparison will be closed as well after a confirmation dialog. move snapshot files up in the list (`ALT-UP`). If your selection is a single interval, the whole block of snapshot files will be moved. move snapshot files down in the list (`ALT-DOWN`). If your selection is a single interval, the whole block of snapshot files will be moved.

| After you've added the involved snapshots, you can create comparisons with the comparison wizards. There are several comparison wizards that group comparisons in analogy to the view sections in the profiling window: the memory comparison wizard the CPU comparison wizard the telemetry comparison wizard The comparison wizards can be invoked from the File menu, from the toolbar as well as from the context menu of the snapshot selector. If you wish to perform the comparison on a subset of the displayed snapshot files, it is easiest to first select the involved snapshots before invoking a comparison wizard. However, all snapshot wizards allow you to change this selection.

| Comparisons are displayed as new tabs in the snapshot comparison window. They can be renamed by choosing View->Rename from the main menu while the view is active. closed by choosing View->Close from the main menu while the view is active. You can also click the tab with the middle mouse button to close it. The above actions are also available in the context menu on the bottom of the tab.

| The comparison wizards are optimized to quickly let you create new comparisons that are similar to previous comparisons. The wizards remember all previous parameters, so to create another comparison with the same parameters but different snapshots, just select new new snapshots in the snapshot selector on the left, invoke the wizard and click on "Finish". To create another comparison with the same snapshots but different parameters, just invoke the wizard, click on "Next" to confirm the comparison type, then click on the step in the index where you wish to make a change and finally click on "Finish".

| Most of the parameters that can be adjusted on the fly in the normal profiling views are selected in the comparison wizards and are fixed once the snapshot comparison has been created. These parameters are displayed in the comparison header which has the same layout for every comparison: In the first line you see the name of the comparison, the following lines are name value pairs of the selected parameters. All comparisons have specific view settings that can be edited by choosing View->View settings from the main menu or the corresponding toolbar button when the comparison is active. Common properties of comparisons include Exporting comparisons to HTML, CSV and XML Undocking comparisons from the main window Sorting tables Source and bytecode viewer. Note: If the source path and class path were not configured correctly in the saved snapshot files, you can use the default file paths in the general settings to add to these paths. Quick search capability