Skip to content

Reduce GC churn on phoenix odometry thread#263

Open
schveiguy wants to merge 1 commit into
Mechanical-Advantage:mainfrom
schveiguy:use-arraylist-phoenix-odometry
Open

Reduce GC churn on phoenix odometry thread#263
schveiguy wants to merge 1 commit into
Mechanical-Advantage:mainfrom
schveiguy:use-arraylist-phoenix-odometry

Conversation

@schveiguy
Copy link
Copy Markdown

Per decompiled Phoenix source, the function BaseStatusSignal.waitForAll and .refreshAll both will call Arrays.asList which allocates a wrapper ArrayList for passing to the underlying library. Declaring as an ArrayList to begin with avoids this extra allocation.

It also simplifies the code a bit to rely on the API of ArrayList instead of implementing appending manually.

instead of a builtin array. Per extracted Phoenix 6 source, the latter is
converted to the former, which is a completely needless allocation for
the call into the library to update signals.
@schveiguy schveiguy force-pushed the use-arraylist-phoenix-odometry branch from 4a27b23 to a66fb2f Compare May 7, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant