···11# Improving Performance
2233+## Profile First
44+55+The `Duration` line of the summary breaks the run down into phases, as percentages of all tracked time:
66+77+```
88+Duration 3.76s (environment 79%, import 14%, transform 6%, tests 1%)
99+```
1010+1111+The percentages are relative to the sum of all tracked phases, not to the wall-clock time: phases run in parallel workers, so their sum is usually larger than the run itself. In a multi-project setup the percentages aggregate over all [projects](/guide/projects), so a phase that dominates one project can be diluted by the others.
1212+1313+The phases map to configuration options:
1414+1515+- `environment` - creating the test environment (`jsdom`, `happy-dom`) for test files.
1616+- `transform` - transforming files with Vite. See [Caching Between Reruns](#caching-between-reruns).
1717+- `import` - importing test files and their modules. When files import mostly the same modules (typical for barrel-file imports), isolation re-evaluates that shared graph for every file. See [Test Isolation](#test-isolation).
1818+- `setup` - running [`setupFiles`](/config/setupfiles).
1919+- `tests` - running the tests themselves. A run dominated by this phase has little to gain from configuration changes.
2020+321## Test Isolation
422523By default Vitest runs every test file in an isolated environment based on the [pool](/config/pool):
···8510386104```shell
87105# the first run
8888-Duration 8.75s (transform 4.02s, setup 629ms, import 5.52s, tests 2.52s, environment 0ms, prepare 3ms)
106106+Duration 8.75s (import 43%, transform 32%, tests 20%, setup 5%)
8910790108# the second run
9191-Duration 5.90s (transform 842ms, setup 543ms, import 2.35s, tests 2.94s, environment 0ms, prepare 3ms)
109109+Duration 5.90s (tests 44%, import 35%, transform 13%, setup 8%)
92110```
9311194112## Node Compile Cache