Monday, June 18, 2007 2:10 PM
Hi WPF team,
can you help me out to knowing about the PresentationFontCache.exe in more details, what exactly it dose. where can i found the documentation on this in MSDN.
when i am running the application first time it is taking more time than the second time. How can i avoid this for first time execution.
what about the disk cache , can we clear it through programmatically.
can anybody help me on the above issues.
Monday, June 18, 2007 6:22 PM
the service description from services.msc is pretty accurate, so let me quote it first:
PresentationFontCache.exe "optimizes performance of Windows Presentation Foundation (WPF) applications by caching commonly used font data. WPF applications will start this service if it is not already running. It can be disabled, though doing so will degrade the performance of WPF applications."
The service is transparent to the WPF applications, so one doesn't need to do anything special to take advantage of it. To speed up the first application startup, you can start the service manually beforehand by doing this "net start FontCache18.104.22.168".
Hope this helps, and best regards,
WPF Text team
Monday, June 18, 2007 6:51 PM
Thanks for the reply.
can you also tell some work around for application execution at first time. My application is having lot load, so when i run this first time it is taking long time then from second time onwards it is loading fast. If i restart the system and run again the same application then it is taking long time to open.
can you help me on this.
Monday, June 18, 2007 7:41 PM
One option is, as I mentioned, to explicitly start the service some time before the application is run, so that the end user doesn't experience the delay. You can automate this process by setting the font cache service startup type to "Automatic" in the services.msc management snap-in.
In addition, I would double check if the problem indeed goes away if you do this. There are other things unrelated to fonts that can slow down the first application startup.
Monday, June 18, 2007 8:18 PMModerator
Another option to improve application load speed is to make sure that all referenced DLLs have unique and valid base address. The base address tells windows where dll prefers to be loaded into memory. All of the pointers to functions and static variables are stored in the dll with offsets based from that base address. If you have dlls with conflicting base addresses in the same applications (by default all dlls get a base address of 0x11000000), windows then has to recalculate all of those offsets at load time and thus you get a performance hit at application load. If you do a search for dll base address performance you will see a ton of articles on how this affects you and how to address it (pardon the pun).
Hope this helps.