Historically, GnuPG stored keys in a flat file (pubring.gpg). Modern versions moved toward keyboxd, a background SQLite-based daemon.
When you run a command like git commit or gpg --list-keys, Windows has to do a bunch of things, and for whatever reason those things are slow.
To shift this work to login time:
- Open Task Scheduler
- Click Create Task and give it a name
- Add the At log on trigger
- Add an action to Start a program with
powershell.exeand the arguments:
-NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command "$ErrorActionPreference='SilentlyContinue'; $env:Path=(Join-Path $env:ProgramFiles 'GnuPG\bin') + ';' + $env:Path; gpgconf --launch keyboxd; gpg-connect-agent /bye;"
See gpg(1), gpgconf(1), and gpg-connect-agent(1).