Skip to content
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

Automatic Profiling #127

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Automatic Profiling #127

wants to merge 25 commits into from

Conversation

wilsonwatson
Copy link
Contributor

Profiling inserted at compile-time to all classes (in package frc) with exception for Main, Robot, and RobotContainer (these have manual implementations). All methods (except autogenerated methods like values, or valueOf; and constructors) are modified with the following:

  • Robot.profiler.push("<class name>:<method name>") at the top of the method
  • Robot.profiler.pop() prior to every return.

Not sure if this works with exceptions. We'll need to investigate. Otherwise, this works as-is.

Future work would include modifying CommandScheduler to add profiling calls there too.

Profiles are captured for every second. We'll need to tune this if on-robot performance gets too bad.

@legoguy1000
Copy link
Member

gave it a quick look, i'm not familiar with the logic on how to insert the methods on build but i'm good with it and testing. for performance, do we want to disable the features when at competition?? maybe disable when FMS is conencted? that way we can still do it in testing but not affect on field performance?

@wilsonwatson
Copy link
Contributor Author

Agreed, that's what EmptyProfiler is for. For now you just have to change Robot.profiler to equal EmptyProfiler.INSTANCE. I don't yet have a strategy for automatically deciding whether or not to profile. The data is useful, but I wouldn't consider it "match data", so it'd be fine to skip during competitions. Ideally we don't disable it unless we have to.

@legoguy1000
Copy link
Member

sounds good. I say we test it thursday and if it works, lets merge 🤷‍♂️.

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.

3 participants