Fixing KeePass’ Slow Startup Performance

If you don’t use a Password Manager to store your login information for websites, first go read this: http://www.troyhunt.com/2011/03/only-secure-password-is-one-you-cant.html.

I’ve been using KeePass for my password manager for years, but noticed that their Professional Edition had a pretty brutal startup delay. As in – launch KeePass and wait 80 seconds for the window to open. While password security is important, that kind of delay will make even the most security-conscious person start thinking about using ‘123456’ for their password instead.

Surprisingly, I hadn’t seen many complaints online (and certainly no solutions), so I decided to see what Process Monitor might say. After setting an application filter for ‘keepass.exe’, here was the answer:

image

At 7:14 and 10 seconds, it starts enumerating the files in the directory where it is installed. And then doing this for every subdirectory. On my machine, that results in processing over 1600 files – as it was a random ‘Tools’ directory with all kinds of junk and support files.

At 7:14 and 55 seconds, it finally completes. And then creates a PluginCache file.

image

If I were a betting man, I’d say that it was looking at each of those 1600 files trying to figure out if they were some sort of KeePass plugin or not. Which takes a long time. This seems even more likely when you load the program a second time. It doesn’t take nearly as long to start because computers are quicker to read files a second time with the assistance of filesystem and hard drive caches.

Fortunately, this is simple to verify:

image

After rebooting to clear the caches (there are more elegant ways), our suspicions are confirmed. Only 2 seconds to launch – the highlighted line is when Keepass brought up its UI:

image

So there are two solutions:

Disable Plugins

If you don’t need plugins, you can just disable them.

Move KeePass

If you need / want plugins, create a subdirectory in your Tools directory for KeePass. For example, c:\Users\Lee\Tools\KeePass. When KeePass launches, it will still scrub through that whole directory and its subdirectories – but there will only be a few files there. Then, put a launcher script in your Tools folder:

:: keepass.cmd

start %~dp0\keepass\keepass %*

8 Responses to “Fixing KeePass’ Slow Startup Performance”

  1. Alan writes:

    Thanks for this article Lee, disabling the plugins really fixed the slow startup of KeePass for me from over a minute to a few seconds!

  2. Wout writes:

    Thanks for the article. My keepass was slow because it searched for keyfiles on network drives. Disabling the auto-search helped my Keepass to become much faster.

  3. Berkin writes:

    Thank you very much. I use keepass every day for years and you may have just saved hours of my life.

  4. João Brito writes:

    Thanks. Looks better. Mine wasn’t too slow but it was annoying to wait say 30 secs to load a small database.

  5. Alan Dooley writes:

    Great stuff, we publish this app via App-V and so it is buried deep in the file structure which was causing a very slow load time…

  6. Dik Pater writes:

    We had the same problems, we solved this by View disable Show Entries of Subgroups , 2 seconds.

  7. Eddie writes:

    Thanks, this was really annoying. We were in the AppV boat as well.

    FYI, these settings are kept under %APPDATA%\KeePass\KeePass.config.xml:

    false

  8. Rudolf Weishaupt writes:

    Thank you very much!

    The first opportunity (Disable Plugins) helped me a lot.

    Kind regards

Leave a Reply