Cold Startup Profiling with Xperf

Gathering a trace

  1. Install xperf by checking the relevant option in microsoft platform SDK installer.
    Do not use a virtual machine for testing.

    Put the following into a batch file:

xperf -on FILE_IO_INIT+FILE_IO+DISK_IO+latency 
xperf -d foo.etl
xperf foo.etl
  1. Delete all files in c:\Windows\Prefetch to make sure prefetch is not changing your results (optionally you want to observe effects of prefetch).

  2. Reboot (apparently CacheSet tool can be used to flush caches).

  3. Run above .bat with admin privs.

  4. Start Firefox.

  5. Go back to the .bat console and hit enter, then hit yes to view the result unprivileged.

  6. Use 'save as' to make a copy for future analysis.

Viewing a trace

  1. Scroll down to the "File I/O" section.

  2. Right click, then select 'view summary'.

  3. Organize your columns to be as follows:
    Process, Event Type, File name, <divider>, Duration, Size

  4. Sort by duration.

  5. Look for large amounts of IO (in bytes, or number of files accessed), and small amounts of IO that take a long time (a sign of inefficient IO pattern, fragmentation, etc.)

Document Tags and Contributors

 Contributors to this page: Sheppy, kscarfone, TarasGlek
 Last updated by: Sheppy,