Skip to content

Instantly share code, notes, and snippets.

@danihodovic
Last active January 5, 2021 19:20
Show Gist options
  • Save danihodovic/5b65a242ce63a5bfe2faab5054e74aff to your computer and use it in GitHub Desktop.
Save danihodovic/5b65a242ce63a5bfe2faab5054e74aff to your computer and use it in GitHub Desktop.
Pyinstaller start up times

Normal

python __init__.py  0.22s user 0.02s system 100% cpu 0.240 total
python __init__.py  0.21s user 0.03s system 100% cpu 0.240 total
python __init__.py  0.22s user 0.03s system 100% cpu 0.244 total

Lazy loading via file exec (not really lazy loading)

python __init__.py  0.27s user 0.02s system 100% cpu 0.288 total
python __init__.py  0.20s user 0.03s system 100% cpu 0.238 total
python __init__.py  0.23s user 0.02s system 100% cpu 0.249 total

Lazy loading imports in command functions

python __init__.py  0.17s user 0.01s system 100% cpu 0.179 total
python __init__.py  0.15s user 0.02s system 100% cpu 0.175 total
python __init__.py  0.16s user 0.02s system 100% cpu 0.172 total

Time with --onefile

(see https://stackoverflow.com/questions/9469932/app-created-with-pyinstaller-has-a-slow-startup/9470393#9470393)

dht  1.00s user 0.16s system 100% cpu 1.156 total
dht  1.04s user 0.13s system 100% cpu 1.171 total
dht  0.97s user 0.18s system 100% cpu 1.142 total

Time without --onefile

./dist/dht/dht  0.28s user 0.03s system 100% cpu 0.303 total
./dist/dht/dht  0.31s user 0.03s system 100% cpu 0.335 total
./dist/dht/dht  0.28s user 0.02s system 99% cpu 0.301 total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment