Faster CLI
#258
Replies: 2 comments
-
Hello Doronz! It's just my opinion, I hope it helps you! :D |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey, focus readability! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I wanted to share with you a python-ish dillema for implementing a significantly faster CLI interface.
Currently, the CLI takes about a whole second to load. This is thanks to the fact we use the
import
statement in the top-level of every module - as the way it should for a more readable code (and a PEP8 restriction).If we make the imports to:
IPython
,pykdebugparser
andfastapi
(the heaviest imports) only inside the pieces of code that actually require them, we can reduce the load time to about 0.3 seconds. This is noticable, but generally python code shouldn't be the most efficient, but more maintainable (which is the main reason why this project started). What do you think? should we balance the readability and CLI efficiency? or should we focus only on readability?Maybe there's a better solution than this we couldn't figure out? please tell us if you have any.
Beta Was this translation helpful? Give feedback.
All reactions