Skip to content

Instantly share code, notes, and snippets.

@niespodd
Last active May 13, 2024 18:48
Show Gist options
  • Save niespodd/c7fd14e0e58652e74c0f1fdbd819112d to your computer and use it in GitHub Desktop.
Save niespodd/c7fd14e0e58652e74c0f1fdbd819112d to your computer and use it in GitHub Desktop.
Chromium patch to reduce CPU load on Swiftshader no-headless
/**
ref: https://cs.chromium.org/chromium/src/components/viz/common/frame_sinks/begin_frame_args.h?q=60hz&dr=C&l=11
The original 16666 corresponds to 60 Hz/FPS: (1 / 60) * 10^6 = 16666μs
**/
diff --git a/components/viz/common/frame_sinks/begin_frame_args.h b/components/viz/common/frame_sinks/begin_frame_args.h
index c4d0e29c7d65..a39ede9849c6 100644
--- a/components/viz/common/frame_sinks/begin_frame_args.h
+++ b/components/viz/common/frame_sinks/begin_frame_args.h
@@ -91,7 +91,8 @@ struct VIZ_COMMON_EXPORT BeginFrameArgs {
// This is the default interval assuming 60Hz to use to avoid sprinkling the
// code with magic numbers.
static constexpr base::TimeDelta DefaultInterval() {
- return base::TimeDelta::FromMicroseconds(16666);
+ return base::TimeDelta::FromMicroseconds(100000);
+ // return base::TimeDelta::FromMicroseconds(16666);
}
// This is the preferred interval to use when the producer can animate at the
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment