arshbot / lnt

Lightning Network Tools -- better lncli for node admins
MIT License
5 stars 0 forks source link

speed up lnt view channel #14

Open arshbot opened 4 years ago

arshbot commented 4 years ago

The command lnt view channel is horrendously slow, especially for a prod node with hundreds of channels. Speed this up to something reasonable

arshbot commented 4 years ago

Did a test against our prod node of how long each portion of this command takes. Here are the results

Channel: 1.50462007522583                                                                                                                                     
Forwards: 0.4369542598724365                                                                                                                                  
Chores: 248.7793128490448
Printing 0.020577192306518555
Final: 250.7416591644287

Clearly the issues is in chores.

arshbot commented 4 years ago

Disabling 1ml in chores leads to the following result

Channel: 1.4831092357635498                                                                                                                                   
Forwards: 0.5506646633148193                                                                                                                                  
Chores: 45.36083388328552 
Printing 0.0033931732177734375
Final: 47.398186445236206

I know I implemented asyncio here and only got a 20% boost - perhaps what @tdickman mentioned is the way to go - i.e. caching. I'm not a huge fan, but this wait is inexcusable for what I assume is merely an alias.

Unfortunately I forgot to push on my other laptop ( I know ), so I might leave this one open until I'm near my other laptop again. Considering implementing the caching tooling before then, but there are tons of other low hanging fruit available for me

arshbot commented 4 years ago

Added asyncio in https://github.com/arshbot/lnt/pull/23