openedx / wg-devops

Issue repository for the DevOps Working Group
1 stars 1 forks source link

Improve Tutor's shell autocompletion response time #26

Open ARMBouhali opened 1 year ago

ARMBouhali commented 1 year ago

Background

I've been using tutor for my deployments since Open edX's maple release, and over 6 months as a development environment. One of the yet-to-be-solved DevExp issues I've faced is the slowness of the shell autocomplete feature.

Here is my experience with testing a basic tutor [tab][tab] in bash.

Tasks

A suggested roadmap:

  1. Find at least one method to profile a tutor CLI autocomplete response time.
  2. Profile response times of a vanilla Tutor CLI (no enabled plugins) autocomplete.
  3. Profile response time of a Tutor CLI with additional plugins and note any overheads.
  4. Profile performance of tutor installed from pypi.org (pip install tutor) vs tutor installed in editable mode (pip install -e git+<tutor-gh-repo>)
  5. Experiment with potential solutions to improve a click CLI performance, and come out with tested recommendations.
  6. Apply recommendations on tutor core and on any plugins providing CLI extensions.
  7. Add CLI performance recommendations to Tutor's plugin development documenation.
  8. Maybe add tests to tutor to ensure an acceptable response time criteria is met.

Notes

  1. This article about Improving the performance of a slow click CLI claims that larger python module imports is one potential bottleneck, and suggests to either move imports inside the command logic, or better to completely separate execution logic from CLI logic.

FYI @regisb

regisb commented 1 year ago

Interesting. I agree that auto-completion is a tad slow. I'm curious to see what we will discover when we profile Tutor. (profiling is always fun!)

kdmccormick commented 3 months ago

Hey @ARMBouhali , do you have any interest in working on this?