<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Apr 13, 2015 at 5:20 PM, Doug Hellmann <span dir="ltr"><<a href="mailto:doug@doughellmann.com" target="_blank">doug@doughellmann.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Excerpts from Sean Dague's message of 2015-04-13 07:15:57 -0400:<br>I *believe* the time is scanning the plugins. It doesn't actually<br>
load them, but it has to look through all of the entry point<br>
registries to find what commands are available. I originally built<br>
cliff (the framework under OSC) this way because I thought we would<br>
put the commands in separate repositories.<br></blockquote><div><br></div><div>FWIW, as things grow commands for projects outside layers 1 & some of 2 are in external repos.  The some of time here is due to doing all imports up front rather than as required; I've proposed <a href="https://review.openstack.org/173098">https://review.openstack.org/173098</a> as the first step to fix this.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Since we aren't doing that for the vast majority of them, we can<br>
change the implementation of cliff to support hard-coded commands<br>
more easily, and to have it only scan the entry points for commands<br>
that aren't in that hard-coded list. We would need to load them all<br>
to generate help output and the tab-completion instructions, but I<br>
think it's OK to take a bit of a penalty in those cases.<br></blockquote><div><br></div><div>If we do the above the entry point scan is maybe two orders of magnitude faster without the forced imports.</div><div><br></div><div>I am also working on at least one deferred import inside cliff itself, cmd2 is pokey...</div><div><br></div><div>dt</div></div><div><br></div>-- <br><div class="gmail_signature"><br>Dean Troyer<br><a href="mailto:dtroyer@gmail.com">dtroyer@gmail.com</a><br></div>
</div></div>