2
1
Is there a way to force Windows to pre-load certain EXE/DLL binaries into its prefetch/superfetch cache as if they had been executed? I have a particular application that loads pretty slowly on first run but if it's "warm" (recently executed) it starts pretty quickly. I'd like to prime the cache early in the background before the application is needed. But since it shows a UI, I'm looking for a way to do this silently. So simply launching the application it isn't ideal.
Thanks you in advance.
Prompted by David's suggestion in the comments, I wrote a PowerShell script to memory map the files, seek to the end, and close them. I haven't done any controlled tests yet and it could just be my imagination, but Sublime Text (the application in question) appeared to load much more quickly this time around and I haven't used it for several hours.
@Josh I know this is an old QA, but do you have an updated link for the PS script? The old link 404s so I removed it – bertieb – 2018-12-27T11:08:06.340
1Just never turn your machine off. – martineau – 2012-12-05T19:13:42.500
Yeah, prefetch/superfetch doesn't work that way but thanks. – Josh – 2012-12-05T19:27:11.560
BTW, never turning it off doesn't mean you can't put it to Sleep/Standby or Hibernate mode. – martineau – 2012-12-05T19:31:13.267
Keeping the machine on doesn't keep the binaries warm in cache. If they aren't used, they'll quickly be purged from memory as other applications are launched. I'll probably wind up having to go with a ramdisk & copy on boot. Bleh. – Josh – 2012-12-05T19:43:50.640
1You would write a program that opens those files, memory maps them, and periodically reads from the mappings. – David Schwartz – 2012-12-05T20:57:26.983
Thanks for the suggestion, David. I will give that a shot. Does it matter if I use read access vs read/execute (even though I won't be actually executing anything.) – Josh – 2012-12-06T21:40:53.850