Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up CLI startup time #176

Open
agriyakhetarpal opened this issue Oct 13, 2024 · 1 comment
Open

Speed up CLI startup time #176

agriyakhetarpal opened this issue Oct 13, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@agriyakhetarpal
Copy link
Owner

Homebrew

❯ hyperfine --warmup 1 "hugo version"
Benchmark 1: hugo version
  Time (mean ± σ):      35.8 ms ±   2.3 ms    [User: 23.1 ms, System: 13.7 ms]
  Range (min … max):    34.2 ms …  53.6 ms    79 runs

hugo-python-distributions

❯ hyperfine --warmup 1 "hugo version"
Benchmark 1: hugo version
  Time (mean ± σ):      54.0 ms ±   5.3 ms    [User: 36.6 ms, System: 18.1 ms]
  Range (min … max):    50.5 ms …  83.7 ms    54 runs

Reading the VERSION file is fast enough, but I wonder if we can optimise further...

@agriyakhetarpal agriyakhetarpal added the enhancement New feature or request label Oct 13, 2024
@agriyakhetarpal
Copy link
Owner Author

with python -X importtime:

tap to show output
❯ python -X importtime hugo version
import time: self [us] | cumulative | imported package
import time:       237 |        237 |   _io
import time:        27 |         27 |   marshal
import time:       203 |        203 |   posix
import time:       246 |        711 | _frozen_importlib_external
import time:       501 |        501 |   time
import time:        75 |        575 | zipimport
import time:       106 |        106 |     _codecs
import time:       185 |        291 |   codecs
import time:       543 |        543 |   encodings.aliases
import time:      1222 |       2054 | encodings
import time:       297 |        297 | encodings.utf_8
import time:        85 |         85 | _signal
import time:        23 |         23 |     _abc
import time:        97 |        120 |   abc
import time:       117 |        237 | io
import time:        37 |         37 |       _stat
import time:        38 |         74 |     stat
import time:       604 |        604 |     _collections_abc
import time:        21 |         21 |       genericpath
import time:        38 |         58 |     posixpath
import time:       367 |       1101 |   os
import time:        76 |         76 |   _sitebuiltins
import time:       527 |        527 |   encodings.utf_8_sig
import time:       292 |        292 |     __future__
import time:       535 |        827 |   _virtualenv
import time:       571 |        571 |   _distutils_hack
import time:       383 |        383 |         types
import time:        50 |         50 |           _operator
import time:       326 |        376 |         operator
import time:        79 |         79 |             itertools
import time:       232 |        232 |             keyword
import time:       246 |        246 |             reprlib
import time:        44 |         44 |             _collections
import time:       930 |       1530 |           collections
import time:        34 |         34 |           _functools
import time:       597 |       2159 |         functools
import time:      1248 |       4164 |       enum
import time:        47 |         47 |         _sre
import time:       369 |        369 |           re._constants
import time:       458 |        826 |         re._parser
import time:       211 |        211 |         re._casefix
import time:       567 |       1650 |       re._compiler
import time:       240 |        240 |       copyreg
import time:       513 |       6565 |     re
import time:      1150 |       7715 |   sitecustomize
import time:      1008 |      11821 | site
import time:       305 |        305 |       warnings
import time:       287 |        592 |     importlib
import time:        32 |        623 |   importlib.machinery
import time:       264 |        264 |     importlib._abc
import time:       124 |        388 |   importlib.util
import time:        60 |       1071 | runpy
import time:        72 |         72 |   hugo
import time:      1626 |       1697 | hugo.cli
import time:        44 |         44 |   _wmi
import time:       824 |        867 | platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant