forked from PX4/PX4-Autopilot
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cpuload.cpp: Add PID hash function to find task structure
Adds a hash function from process PID to store and find corresponding task info structure, instead of looping through the list. This reduces complexity from O(n) to O(1) when calling sched_note_ functions, greatly reducing CPU load when there are a lot of processes and context switches.
- Loading branch information
Showing
1 changed file
with
111 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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