Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR focuses on improving performance and reliability by introducing concurrency for independent API calls, standardizing HTTP requests through a shared client, and replacing custom helpers with standard library equivalents.
Changes:
- Added a shared
HTTP_CLIENTwith timeouts/transport settings and migratedhttp.Getcall sites to use it. - Parallelized several route and stats operations using
errgroup/goroutines to reduce response latency. - Replaced custom slice/search and sorting helpers with
slices.Containsandsortpackage utilities; added caching for regex compilation and image decoding.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utility/helper.go | Caches DOMAIN once, replaces custom sort/regex usage with stdlib (sort, cached regexp). |
| src/stats/skills.go | Switches from utility.Contains to slices.Contains. |
| src/stats/other.go | Parallelizes member formatting via goroutines/channels. |
| src/stats/leveling/leveling.go | Switches from utility.Contains to slices.Contains. |
| src/stats/items/helper.go | Switches from utility.Contains to slices.Contains in item gem/category parsing. |
| src/stats/accessories.go | Uses slices.Contains for accessory detection. |
| src/routes/stats.go | Parallelizes profile/player and museum/members fetches via errgroup. |
| src/routes/skills.go | Parallelizes profile/player fetch via errgroup. |
| src/routes/misc.go | Parallelizes profile/player fetch via errgroup. |
| src/routes/item.go | Updates RenderItem call signature. |
| src/routes.go | Prefork-aware initialization flow; enables ETag middleware. |
| src/lib/renderer.go | Adds singleflight for head rendering, in-memory image cache, avoids temp files, updates RenderItem signature and HTTP usage. |
| src/lib/custom_resources.go | Adds compiled-regex cache to avoid repeated regexp.Compile. |
| src/api/mowojang.go | Uses shared HTTP_CLIENT instead of http.Get. |
| src/api/hypixel_constants.go | Uses shared HTTP_CLIENT instead of http.Get. |
| src/api/hypixel.go | Uses shared HTTP_CLIENT instead of http.Get. |
| src/api/client.go | Introduces shared HTTP client configuration. |
| main.go | Adds Fiber read/write/idle timeouts. |
| NotEnoughUpdates-REPO | Updates submodule commit. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.