# Scenario A: Intra seek times

## Introduction

This scenario will demonstrate an example of how the File Profile Analyzer was used on Fifa Street 3 to help improve load times. In this scenario the File Profile Analyzer analyzer was used on XBOX 360 profile data to help improve intra seek time.

## The case

We loaded the profile data in the File Profile Analyzer which gave the following result:

Looking at the sum graph it is clear that the seek times are the most important factor in the load times. This can be seen because the seek time line (the blue line) is fairly steep and for a large part above the other lines. Note especially that the seek time line is above the read time line (the green line), which means that there is more time spent on seeking on the media than time spent actually reading data.

Also from the profile summary (on the bottom-left side of the main form) it is clear the total time is 11,862 ms and the seek time is 5,008 ms. The seek time takes up a fairly large portion of the total time, which confirms the idea we got when looking at the sum graph. The details of the seek time show that out of 5,008 ms of seek time about 1,144 ms are inter file seeks and about 3,863 ms are intra seek time. (Note that there is 1 ms of time disappearing, 5008 - 1144 - 3863 = 1, because of rounding of to milliseconds.) Clearly there is something wrong with the intra file seek times.

To figure out which files make up the largest portion of the load we `click` in the sum graph in the area where the seek time line is steep. This highlights a portion of the line that is associated with the file at that time and selects it in the overview as well:

Note that the profile summary updates as well.

Because the selection only overs about one third of the file, and does not include the last part of the profile we want to select more files. While holding down `CTRL` we `click` again in the last part of the profile. This selects another file for which the lines are highlighted as well as the file is added to the selection in the overview:

To confirm that we have the top 2 intra file seek time files, we click on the `Intra seek time` column header in the overview. This sorts the selected files based on the intra seek time. Note that because the files were already in ascending order the first click on the `Intra seek time` column header sorts the list in descending order, hence we click again to get it in ascending order but the two files at the top:

So now we know what the problem is, and we know where the problem is. Unfortunately the File Profile Analyzer does not provide a solution for the problem so the next step requires some thinking on your part.

We could cache the files because the Profile Summary indicates that only 42.32 MB of data is loaded for the selected files. We could even use an existing technology like Incremental Installer so that we don't have to write our own solution. But our title does not want to cache these files, so we will have to figure out what is going on.

Intra file seek time means seek time within a file. Since we did not use the Simple Profiler the archive (BIG) files appear as one file. From this we can deduce that the content within the archive files is not properly ordered. For example the data is ordered as: A, B, C, while the data is accessed in C, B, A order. Meaning there the device will seek from begin to C, from C to B and from B to A. We should reorder the data within the archive file so that the data is in C, B, A order.

Now because we did not use the Simple Profiler we have to come up with a way of figuring out in which order the data files were accessed. Note that figuring that out is beyond the scope of this tutorial, since it implies either knowledge, magic, some-one on the team who happens to know the order or adding some logging code to the project.

Suffice to say a way was figured out and the files have been reordered. So let's run the game again and load up the profile data it generates:

It is obvious that the seek line (the blue line) is now always below the idle line (red line). Looking at the Profile Summary we can see that the total time has dropped to 9,317 ms of which 3,010 is seek time. That is almost 2,000 ms less seek time. The intra file seek time has dropped from 3,863 ms to 1,666 ms which confirms that reordering the archive files was a good thing to do. Note that the inter file seek time went slightly up from 1,144 ms to 1,343 ms. This is probably because the last file used from the archive is is bit 'further away' from the next archive file causing a slightly larger inter file seek.

Finally to compare the different graphs we open both profiles and click on the menu bar on `Window-Tile horizontally`. Because the graph is the only thing we are interested in at this point we disable the overview and the time portions by clicking on the menu bar on `View-Overview` and `View-Time`. These options toggle between displaying the feature or hiding it. This provides us with the following image:

## Conclusion

Using the File Profile Analyzer provided the insight that the intra seek times were exceptionally high. Previously high seek times were compensated by installing the files onto the hard drive, using a technology like Incremental Installer, because the hard drive has faster seeks. However in this case we did not want to, or were not allowed to solve the problem with that approach. With the use of File Profile Analyzer it became apparent that the intra seek times were especially high for the archive (a.k.a. BIG) files.

To solve this problem, Frank Barchard used a custom script he wrote to reorder the contents of the archive files. Note that this script is currently not available in productized form yet, but if there is interest in this we will productize it. Using this script did not involve code changes to the source code of the project, hence techniques like this are even usable late in the development cycle.

Feedback? Please provide us with your comments on this topic.
For more help, send us an email
© 2007 Electronic Arts. All rights reserved.