Skip to content

Commit 5d28969

Browse files
authored
perf(zaparoo): reduce launcher startup contention
2 parents a846712 + c634ffc commit 5d28969

5 files changed

Lines changed: 180 additions & 73 deletions

File tree

main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
3434
#include "scheduler.h"
3535
#include "osd.h"
3636
#include "offload.h"
37+
#include "hardware.h"
3738

3839
const char *version = "$VER:" VDATE;
3940

4041
int main(int argc, char *argv[])
4142
{
43+
printf("ZAPAROO_T2 main_start_ms=%lu\n", GetTimer(0));
44+
4245
// Always pin main worker process to core #1 as core #0 is the
4346
// hardware interrupt handler in Linux. This reduces idle latency
4447
// in the main loop by about 6-7x.

scheduler.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "scheduler.h"
22
#include <stdio.h>
3+
#include <unistd.h>
34
#include "libco.h"
45
#include "menu.h"
56
#include "user_io.h"
@@ -86,6 +87,8 @@ void scheduler_run(void)
8687
for (;;)
8788
{
8889
scheduler_schedule();
90+
if (alt_launcher_scheduler_sleep_enabled())
91+
usleep(100);
8992
}
9093

9194
co_delete(co_ui);

0 commit comments

Comments
 (0)