Compare commits

..

No commits in common. "60e9130891af527d78e6ab6d83f435a5cee4a353" and "3310394fb86bf8129d6f7bf15e0183d45353f4ac" have entirely different histories.

2 changed files with 13 additions and 28 deletions

View file

@ -196,37 +196,26 @@ function OutfitMovieLayer({
let lastFpsLoggedAtInMs = performance.now(); let lastFpsLoggedAtInMs = performance.now();
let numFramesSinceLastLogged = 0; let numFramesSinceLastLogged = 0;
const intervalId = setInterval(() => { const intervalId = setInterval(() => {
updateStage();
numFramesSinceLastLogged++;
const now = performance.now(); const now = performance.now();
const timeSinceLastFpsLoggedAtInMs = now - lastFpsLoggedAtInMs; const timeSinceLastFpsLoggedAtInMs = now - lastFpsLoggedAtInMs;
const timeSinceLastFpsLoggedAtInSec = timeSinceLastFpsLoggedAtInMs / 1000; const timeSinceLastFpsLoggedAtInSec = timeSinceLastFpsLoggedAtInMs / 1000;
if (timeSinceLastFpsLoggedAtInSec > 2) {
const fps = numFramesSinceLastLogged / timeSinceLastFpsLoggedAtInSec; const fps = numFramesSinceLastLogged / timeSinceLastFpsLoggedAtInSec;
const roundedFps = Math.round(fps * 100) / 100; const roundedFps = Math.round(fps * 100) / 100;
// If the page is visible, render the next frame, and track that we did.
// And if it's been 2 seconds since the last time we logged the FPS,
// compute and log the FPS during those two seconds. (Checking the page
// visibility is both an optimization to avoid rendering the movie, but
// also makes "low FPS" tracking more accurate: browsers already throttle
// intervals when the page is hidden, so a low FPS is *expected*, and
// wouldn't indicate a performance problem like a low FPS normally would.)
if (!document.hidden) {
updateStage();
numFramesSinceLastLogged++;
if (timeSinceLastFpsLoggedAtInSec > 2) {
console.debug( console.debug(
`[OutfitMovieLayer] FPS: ${roundedFps} (Target: ${targetFps}) (${libraryUrl})`, `[OutfitMovieLayer] FPS: ${roundedFps} (Target: ${targetFps}) (${libraryUrl})`,
); );
if (onLowFps && fps < 2) { if (onLowFps && fps < 2) {
onLowFps(fps); onLowFps(fps);
} }
lastFpsLoggedAtInMs = now;
numFramesSinceLastLogged = 0;
}
} else {
// Otherwise, if the page is hidden, keep resetting the FPS tracker
// state, to be able to pick up counting fresh once we come back.
lastFpsLoggedAtInMs = now; lastFpsLoggedAtInMs = now;
numFramesSinceLastLogged = 0; numFramesSinceLastLogged = 0;
} }

View file

@ -11,10 +11,6 @@
# dev_ips # dev_ips
- files/setup_secrets.yml - files/setup_secrets.yml
tasks: tasks:
- name: Set hostname to impress.openneo.net
hostname:
name: impress.openneo.net
- name: Create SSH folder for logged-in user - name: Create SSH folder for logged-in user
become: no become: no
file: file: