Cut Your Test Runtime In Half With This One Weird Trick
Weston's test runtime is dominated by output-damage. On my laptop (and this seems vaguely consistent with CI), it takes approx. 4.5sec to run. In this 4.5sec, it spawns a compositor 42 times (taking a screenshot twice each time), which seems kind of unfortunate since we're losing parallelism on our long pole - everything else completes long before output-damage does.
But there's an easy way to reduce that 4.5s runtime to like 2s, and to reduce output-transforms from 3.5s to 1.3s! You can do it without touching the test suite or any of the tests, and by deleting a single character:
diff --git a/libweston/backend-headless/headless.c b/libweston/backend-headless/headless.c
index 83de39dc5..b121235fc 100644
--- a/libweston/backend-headless/headless.c
+++ b/libweston/backend-headless/headless.c
@@ -146,7 +146,7 @@ headless_output_repaint(struct weston_output *output_base,
pixman_region32_subtract(&ec->primary_plane.damage,
&ec->primary_plane.damage, damage);
- wl_event_source_timer_update(output->finish_frame_timer, 16);
+ wl_event_source_timer_update(output->finish_frame_timer, 1);
return 0;
}
Obviously this is not a serious suggestion to upstream this one patch, but yeah, we should really make the refresh period configurable, and push it as low as possible in the test suite unless we're actually, y'know, wanting to simulate 'real-world' timings.