You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optimize Receiving Objects Step to Reduce Initialization Delay (#842)
Description
This PR addresses issue #842 by improving the performance of the receiving objects step in the engine.
It reduces the delay when processing incoming objects, ensuring smoother initialization and better overall responsiveness.
Thanks for the PR! A few things to address before this can land:
Correctness regression in the axes copy (blocker). The new code resizes axesbefore snapshotting it into previousAxes. If gamepad.axes.length ever differs from the previous axes.length, previousAxes ends up with undefineds (when growing) or silently drops tail values (when shrinking). Please snapshot axes → previousAxes using the old length first, then resize and copy gamepad.axes → axes.
Style / lint.for(let → for (let, add spaces around <, use the cached-length idiom (for (let i = 0, l = arr.length; i < l; i++)) like the rest of the file, drop the double blank line, and reword the misleading // resizing array if size changed comment (the resize is unconditional). npm run lint will flag some of these.
PR title/description look copy-pasted from a different template and don't describe what this PR actually does. Please update them to cover the gamepad axes change and also mention the unrelated buttons[i] → buttons[j] fix in get previous() so it isn't missed.
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
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.
Optimize Receiving Objects Step to Reduce Initialization Delay (#842)
Description
This PR addresses issue #842 by improving the performance of the receiving objects step in the engine.
It reduces the delay when processing incoming objects, ensuring smoother initialization and better overall responsiveness.
Fixes #842
Checklist