Add repository memory/speed audit and upgrade plan#2
Open
schartrand77 wants to merge 1 commit intomainfrom
Open
Add repository memory/speed audit and upgrade plan#2schartrand77 wants to merge 1 commit intomainfrom
schartrand77 wants to merge 1 commit intomainfrom
Conversation
Reviewer's GuideAdds a new performance and memory audit document for the StockWorks app, outlining current frontend/backend bottlenecks and a prioritized implementation plan for performance-related improvements. Sequence diagram for optimized frontend refresh and single-pass report renderingsequenceDiagram
actor User
participant UI as Browser_UI
participant API as Backend_API
User->>UI: Click Refresh
UI->>UI: refreshAll()
activate UI
UI->>API: GET /materials?suppressReports=true
UI->>API: GET /inventory?suppressReports=true
UI->>API: GET /hardware?suppressReports=true
UI->>API: GET /models?suppressReports=true
API-->>UI: materials JSON
API-->>UI: inventory JSON
API-->>UI: hardware JSON
API-->>UI: models JSON
UI->>UI: Update in-memory stores
UI->>UI: Debounced renderReports() (single call)
UI-->>User: Updated dashboards and tables
deactivate UI
ER diagram for indexed inventory and movement relationshipserDiagram
MATERIAL {
int id PK
string name
string category
}
INVENTORYITEM {
int id PK
int material_id FK
string location
int quantity
}
STOCKMOVEMENT {
int id PK
int inventory_item_id FK
datetime created_at
int quantity_delta
}
HARDWAREITEM {
int id PK
string category
string name
}
HARDWAREMOVEMENT {
int id PK
int hardware_item_id FK
datetime created_at
int quantity_delta
}
PRINTMODEL {
int id PK
string name
}
PRINTMODELSALE {
int id PK
int model_id FK
datetime sold_at
int quantity
}
MATERIAL ||--o{ INVENTORYITEM : has
INVENTORYITEM ||--o{ STOCKMOVEMENT : tracks
HARDWAREITEM ||--o{ HARDWAREMOVEMENT : tracks
PRINTMODEL ||--o{ PRINTMODELSALE : sells
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
app/backend (FastAPI + SQLModel) andapp/static/app.jsfrontend so maintainers have prioritized, actionable recommendations to reduce CPU, network, and browser memory usage.Description
docs/performance_audit.mdcontaining findings (refresh fan-out/report duplication, unbounded list APIs, potential N+1 relation loads, expensive client-side filtering/sorting, and DB/index opportunities) and a prioritized set of recommendations (single-pass report rendering, pagination and envelope responses, eager loading/lightweight DTOs, indexing/SQLite PRAGMA tuning, background sync/caching, HTTP caching, and observability suggestions).Testing
python -m compileall appto validate the Python codebase compiled successfully.Codex Task
Summary by Sourcery
Documentation: