Repository navigation
perf: solar- en serverstatus al tijdens het 3D-laden ophalen - #70
Merged
Merged
Conversation
De menubalk zit in de 3D-scène en mount pas als alle modellen geladen zijn, waardoor /api/solar en /api/host pas daarna vertrokken en de cijfers zichtbaar inschoten. main.tsx start beide requests nu vóór de render; de hooks pakken het resultaat uit hun bestaande cache. useHostStats slaat de directe eerste fetch over als de prefetch al een meting heeft, zodat er geen dubbele 1s-cpu-sample komt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Wat
prefetchSolar()enprefetchHostStats()in de bestaande hooks; ze hergebruiken de module-cache en gedeelde promise.main.tsxroept beide aan vóór de React-render, dus de requests lopen parallel aan het laden van de 3D-modellen.useHostStatsdoet geen directe eerste fetch meer als de prefetch al een meting heeft (voorkomt een tweede 1s-cpu-sample vlak na de eerste); het pollen blijft ongewijzigd.Waarom
De menubalk zit in de 3D-scène en mount pas als alles geladen is. Daardoor vertrokken
/api/solaren/api/hostpas daarna en schoten de cijfers zichtbaar in.Getest
tsc -b,eslint,vitest(65 tests) groen./api/solaren/api/hoststarten tegelijk metmac-draco.glbin plaats van erna. (/api/hostgeeft lokaal op macOS 501 omdat/procontbreekt; dat is bestaand gedrag.)🤖 Generated with Claude Code