BradenM / BradenM/micropy-cli

Stub Loading is Slow and Repetitive

Open
#56 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
337
Forks
29
PR merge metrics
No merged PRs in 30d

Description

Currently, loading stubs requires validating the same stubs multiple times. Since the stub JSON file is read from on each validation, this is a very slow and repetitive process. When you have ~5 or more stub packages, executing `micropy` tends to have a very noticeable delay.

A much faster solution would be to only validate when a stub is added (not just loaded from the `stubs` folder) then create and save an md5 hash of the stub info file along with what type of stub it is. We can then "validate" and determine existing stubs by reading from this one file, rather than re-validating them all.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how micropy loads stub packages from the stubs folder and how each stub JSON file is validated. Review the existing add-stub path before changing the loading path. Done means loaded stubs avoid repeated validation while newly added stubs are validated and their type and md5 information are saved for later checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.