-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NEW: Input System Profiler Module #2038
base: develop
Are you sure you want to change the base?
Conversation
var controlCount = ProfilerDriver.GetFormattedCounterValue(selectedFrameIndex, | ||
InputStatistics.Category.Name, InputStatistics.ControlCountName); | ||
|
||
m_UpdateCountLabel.text = $"{InputStatistics.UpdateCountName}: {updateCount}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a basic label list at the moment. Is it possible to pass any extra information via the profiler API? Or extract sample data to e.g. create a distribution within detail window?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a ProfilerRecorder that you can use to gather samples, which then allows you to do more statistical computations.
{ | ||
try | ||
{ | ||
DoUpdate(updateType, ref eventBuffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs more work to extract some stuff from DoUpdate below
InputStatistics.EventSize.Value += totalEventSizeBytes; | ||
InputStatistics.AverageLatency.Value += ((totalEventLag / totalEventCount) * 1e9); | ||
InputStatistics.MaxLatency.Value += (maxEventLag * 1e9); | ||
InputStatistics.EventProcessingTime.Value += eventProcessingTime * 1e9; // TODO Possible to replace Stopwatch with marker somehow? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this last line here is an anti pattern, ideally I would like to include the Update profiler marker into the profiler module, is this possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During hackweek I used StopWatch. It was preallocated and reset and reused every frame and accumulated in a ProfilerCounter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which is what it looks like you're doing here :)
My first thought looking at the window is the mix of types being presented. I see Counters, Memory Size, and Times. It looks a little bit busy and hard to know what I'm looking at exactly. Overall I think this is a great idea. I wonder if there's a way we can group like values together within one window. |
Agreed, I just saw other modules were doing that and replicated it. I think there is opportunity to slip things into separate modules to handle it, e.g. Latency and Input System Counters. I wonder if execution time should even be there since its covered by the ProfilerMarkers anyway..... |
Description
Made a draft implementation of a Profiler Module for the Input System based on lack of observability to work as an aid in understanding system mechanics. Hopefully could work as an embryo of something more refined if considered a good idea.
Testing status & QA
Just a prototype at this point. Try it out and suggest or contribute to this PR to make it more useful.
Overall Product Risks
Some more work likely need to be done to InputManager.OnUpdate to make that method cleaner and this work more reliably.
Might not be possible to merge unless minimum Unity version requirement is changed to 2020.1. (Profiler package dependency)
Comments to reviewers
At this point mainly looking for feedback and suggestions since this was unplanned work.
Checklist
Before review:
Changed
,Fixed
,Added
sections.Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
.During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.After merge: