Skip to content

Commit 09abad2

Browse files
committed
Add progress update.
1 parent 953fbde commit 09abad2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

speedup_import.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ $ ./mtime.sh ~/.pyenv/versions/cmd2-3.6/bin/python -c "import cmd2"100 iteration
6565
average: real 0.120 user 0.081 sys 0.021
6666
```
6767

68-
# Defer datetime, functools, io, subprocess, traceback
68+
## Defer datetime, functools, io, subprocess, traceback
6969

7070
In commit d9ca07a9 we defer 5 more imports: datetime, functools, io, subprocess, traceback.
7171
```
@@ -74,12 +74,18 @@ $ ./mtime.sh ~/.pyenv/versions/cmd2-3.6/bin/python -c "import cmd2"
7474
average: real 0.115 user 0.080 sys 0.020
7575
```
7676

77-
# extract AddSubmenu to its own file
77+
## extract AddSubmenu to its own file
7878

7979
In commit ccfdf0f9 we extract AddSubmenu() to it's own file, so it is not
8080
imported or processed by default.
8181
```
82-
./mtime.sh ~/.pyenv/versions/cmd2-3.6/bin/python -c "import cmd2"100 iterations
82+
./mtime.sh ~/.pyenv/versions/cmd2-3.6/bin/python -c "import cmd2"
83+
100 iterations
8384
average: real 0.117 user 0.081 sys 0.021
8485
```
8586

87+
## Progress Update
88+
89+
Python takes ~30ms to start up and do nothing. When we began we estimated it took
90+
~110ms to import cmd2. We are now down to about ~90ms, which is approximately a
91+
20% improvement.

0 commit comments

Comments
 (0)