Closed diegodelemos closed 4 years ago
pyparsing.py
core.py
cli.py
__init__
_bootstrap
moduleUsed the native tool cProfile
. Only the first X lines are shown of the output of cProfile
.
ncalls
: number of calls for this functiontotime
/percall
: time spent inside the body of the function (by eg. loops, I/O, ...). Further calls are excluded from this count (percall
is the average time per call, totime
is the sum for all calls)cumtime
/percall
: time spent between the time the function is called and until it returns (same thing for cumulative / per call)invenio --help
invenio --version
invenio access list
invenio routes
pyparsing.py
has the longest total times (time spend inside the body of the function, call to other functions excluded) and it also significantly contibutes to the cumulative time. core.py
(of click package) has long cumulative times especially in the --help
command.cli.py
has long cumulative times as well._bootstrap
module has long cumulative times too.__init__
Full report codiMD here.
invenio --help
Before:
Time: ~2.05s
Graph:
After:
Time: ~1.92s
Graph:
invenio routes
Before:
Time: ~2.00s
Graph:
After:
Time: ~1.88s
Graph:
invenio-base
registers a cli application itself under inveniomanage
command. The same functionality is also provided when invenio-app
creates the cli. Should we contain the instantiation of apps
only in the invenio-app
and use invenio-base
for their implementation?create_app_factory
is invoked three times, for creating the apis
, for the ui
and finally to create the app
which is a combination of the previous two.
Currently, the Invenio CLI runs very slowly, we should:
Note that:
invenio
notinvenio-cli
.