perf(input): controller polling allocates on every tick
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 54/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- game-dev, performance
Direzione di ricerca
Start with modules/input/src/controller/controller-handler.ts at the two linked ranges and trace poll() plus getStick, getPressedKeys, and getMousePosition. Check how controller state is consumed and what tests cover polling and getters. Done means polling and getter calls reuse objects where practical while preserving input behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Which package or utils is this feature request for?
input
Feature
Each poll() (called every tick) creates a Set, a key array, and for each pad a new state object, ~17 button objects and an axes array, even when nothing changed. getStick, getPressedKeys and getMousePosition also return new objects on every call. This is steady garbage on the game loop, against the repo's rule for per-frame code.
Where:
modules/input/src/controller/controller-handler.ts:47-57modules/input/src/controller/controller-handler.ts:126-140
Evidence:
const seen = new Set<number>();
for (const index of [...this.controllers.keys()]) {
buttons: gamepad.buttons.map((button, i) => ({ ...nextButtonState(...), value: button.value })),
axes: [...gamepad.axes],
Ideal solution or implementation
Keep one ControllerState per pad and update it in place, reuse seen, and offer cached or out-parameter getters.
Alternative solutions or implementations
No response
Other context
Found during a code audit of main at be72076.
- Lingua principale
- TypeScript
- Stelle
- 7
- Fork
- 2
- Merge medio
- 1g 17h
- PR unite (30g)
- 17
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NanoForge-dev/Engine
-
dependencies enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NanoForge-dev/Engine#513 ·
I maintainer di solito rispondono entro 1 giorno
-
bug chore tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
NanoForge-dev/Engine#511 ·
I maintainer di solito rispondono entro 1 giorno
-
docs(network): TSDoc says ICE_SERVERS defaults to an empty list, the code uses public STUN serversApertadocumentation good first issue modules:network
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
NanoForge-dev/Engine#509 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation modules:ecs packages:asset packages:core
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NanoForge-dev/Engine#508 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue modules:music modules:sound
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NanoForge-dev/Engine#505 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di NanoForge-dev/Engine
Issue simili
-
Mend: dependency security vulnerability
Difficoltà 1/5 1-3 ore Idoneità per principianti 65/100
fdm-monster/fdm-monster#5563 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
growilabs/growi#12246 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
🐛 The Rulekeeper - An index run that gives up on the lock ends SucceededForse già presa @github-actions l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SSWConsulting/SSW.Rules#2809 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
automated-triage type/bug type/ci
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno