Description
The application reads and parses projects.json repeatedly across route contexts. Parsing JSON from the filesystem on every request wastes CPU cycles and adds I/O overhead. We should load and parse the file once on application start and cache the Python structure in memory.
Current Behavior
projects.json is re-read and parsed repeatedly.
Proposed Solution
- In
src/utils/data_loader.py, introduce a global cache variable _projects_cache protected by a thread lock.
- Fetch from the cache if it is initialized, otherwise read the file, validate it, and store it.
- Expose a
clear_projects_cache() function for testing.
Implementation Guidance
- Modify
src/utils/data_loader.py.
Acceptance Criteria
Contributor Guidelines
Interested in working on this issue?
- Comment
/assign to request assignment.
- Wait until the issue shows you as the assignee.
- Create a new branch for your changes.
- Submit a Pull Request referencing this issue.
Please do not begin working on an issue already assigned to another contributor unless a maintainer confirms it is available.
Description
The application reads and parses
projects.jsonrepeatedly across route contexts. Parsing JSON from the filesystem on every request wastes CPU cycles and adds I/O overhead. We should load and parse the file once on application start and cache the Python structure in memory.Current Behavior
projects.jsonis re-read and parsed repeatedly.Proposed Solution
src/utils/data_loader.py, introduce a global cache variable_projects_cacheprotected by a thread lock.clear_projects_cache()function for testing.Implementation Guidance
src/utils/data_loader.py.Acceptance Criteria
Contributor Guidelines
Interested in working on this issue?
/assignto request assignment.Please do not begin working on an issue already assigned to another contributor unless a maintainer confirms it is available.