snet-cli
snet-cli copied to clipboard
snet-cli is slow. Is it an issue?
In the current stage snet-cli adds ~1-0.7 sec overhead to each operation. for example:
time snet version
Should we consider it as a problem?
IMO for this kind of tool it is ok.
The web3
module by itself is heavy to be loaded.
If we start use snet-cli as a basis for SDK it might be a problem, and there are different possible solutions...
For example it is an issue for #108. We need to optimize "imports"...
Agree.
Maybe a good approach will be isolate functions that don't need web3
module in separated files.
I'm not a fan of "import on demand", but it's a valid way to go too.
This is particularly noticeable on lower power devices like raspberry pi:
$ time snet version
version: 0.2.10
real 0m29.143s
user 0m27.907s
sys 0m1.162s
(Python shell starts relatively quickly and takes 0.5s to run a statement so it's not just python start up time.)
@ferrouswheel yes. I guess (but it should be studied) the main problem is in relatively "heavy" libraries (as web3) which we use, so it simply takes time to import them.
What exactly would you like to do on raspberry pi? Only make a call?
@astroseger Yeah just making calls, but still need to do the various setup calls for identity and channels.
I want to demonstrate our tooling works with raspberry pi and low-powered devices that can be used for IoT (or at least find out what hurdles there are!). More realistically I guess people would probably use the sdk, but it'd be nice if the commands only imported the libraries they needed, then local config and other things that don't need web3 would run faster.
If we did use conditional imports, then it'd be good to do imports after parsing command line arguments. That way if someone uses the wrong arguments they will get feedback immediately.