-
Notifications
You must be signed in to change notification settings - Fork 4
Best practice
Learn how do the author may use this tool.
Start from prefetch 2.0, a new work approach introduced to optimize performance.
Version 1.3 rely on manually rule, depending on software and user knowledge, result can differ.
For example, many files are prefetch to RAM, however the software doesn't need these files in the end.
There are ExcludeFolder and PriorityIncludePattern to help filter out unwanted files.
I found sysinternals procmon.exe
Process Monitor,
it can record every file a process ever accessed during startup.
Use Firefox as example, download and open procmon, change filter to these:
- Process Name is
firefox.exe
Include
Only include Firefox activity - Operation contains
Reg
Exclude
Remove registry activity - Operation contains
Tcp
Exclude
Remove network activity - Any other filter you'd like to add
- Make sure Firefox is not run, click clear button to delete exist record
- Start Firefox, wait until you feel Firefox is stopped reading disk
- Click save button to save csv
- Get ParseProcmonLog.py, tested under
python 3.9.10
. - Run
python ParseProcmonLog.py Logfile.CSV firefox path.txt
The result will save topath.txt
, it's a regex pattern. - Open
prefetch.ini
, add all Firefox program files folder
to both[PrefetchFolder]
and[ExcludeFolder]
- For
[PriorityIncludePattern]
Copy and paste the result generated by ParseProcmonLog - You may still need to exclude some noncritical file manually to prevent cache unnecessary files.
Look atprefetch.cache.ini
to figure out what file are matched.
Now, the prefetch.ini
should look like this:
[PrefetchFolder]
FirefoxAppdataLocal=C:\\Users\\<your user name>\\AppData\\Local\\Mozilla\\Firefox
FirefoxAppdataRoaming=C:\\Users\\<your user name>\\AppData\\Roaming\\Mozilla\\Firefox
FirefoxProgramFiles=C:\\Program Files\\Mozilla Firefox
[ExcludeFolder]
FirefoxAppdataLocal=C:\\Users\\<your user name>\\AppData\\Local\\Mozilla\\Firefox
FirefoxAppdataRoaming=C:\\Users\\<your user name>\\AppData\\Roaming\\Mozilla\\Firefox
FirefoxProgramFiles=C:\\Program Files\\Mozilla Firefox
[PriorityIncludePattern]
FirefoxFiles=firefox\.exe$|^(?!.*http)^(?!.*archive)^(?!.*log)^(?!.*backup)^(?!.*debug)^(?!.*crash)(.*\\.txt$|.*\\.db-journal$|.*\\.js$|.*\\.metadata$|.*\\.ico$|.*\\.db$|.*\\.tmp$|.*\\.sqlite-journal$|.*\\.baklz4$|.*\\.db-wal$|.*\\.xpi$|.*\\.list$|.*\\.default$|.*\\.files$|.*\\.DLL$|.*\\.sqlite-wal$|.*\\.dll$|.*\\.sbstore$|.*\\.css$|.*\\.dat$|.*\\.lock$|.*\\.test$|.*\\.sqlite-shm$|.*\\.json$|.*\\.log$|.*\\.ja$|.*\\.mozlz4$|.*\\.ttf$|.*\\.stash$|.*\\.little$|.*\\.jsonlz4$|.*\\.sqlite$|.*\\.mdb$|.*\\.vlpset$|.*\\.lz4$|.*\\.bin$|.*\\.filter$|.*\\.info$|.*\\.ini$)
I have discovered that use prefetch is faster than not use prefetch,
even for the first time on cold boot.
So if a software is start only once and have no plan to restart in the future,
check rocket launch command line argument.
Use StartToTray and prefetch_performance.exe
to speed up further,
because no GUI stuff is needed in a rocket launch instance.
Use ReadThreadPriority HighPriority
too.
For example, you use a shortcut (*.lnk
) to prefetch.exe firefox.ini -rocketLaunch
,
instead of default Firefox shortcut to start Firefox.
You may also assign a Firefox icon for it as a complete replacement.
Try to keep only one running prefetch instance at a time to avoid resource contention.
If you have multiple software run on boot and rocket launch,
group them into one prefetch.ini
instead of start multiple simultaneously.
You can also set "rocket launch prefetch" as startup item of "background daemon prefetch",
so they executed one after another.
Other real world program may abuse the standby list.
I had an example at issue 6:
The Steam download can fill standby list without release after task complete.
Rather than reboot computer, use memreduct may or may not worth.
This one has a constantly updated statistics and can't be disabled.
Good news: memreduct support command line options to clear standby list and quit.
Start from prefetch version 2.8
, you can use custom tray menu feature to launch memreduct:
- Open memreduct as administrator, goto File\Settings\Memory cleaning
- Uncheck all but check
Standby list* (vista+)
- Create a shortcut
memreduct.lnk
to memreduct.exe - Right-click the shortcut\Properties\Advanced\Check Run as administrator
- Modify Target, append
-clean
aftermemreduct.exe
- Put the shortcut together with
prefetch.exe
- In
prefetch.ini
, edit[CustomTrayMenu]
[CustomTrayMenu]
Clear cache=run explorer .\\memreduct.lnk
Run prefetch.exe
, right click on tray icon, click on Clear cache
to use memreduct.
If you have an operating system before Vista, you can use your own memory cleaning tool chain.