Skip to content

Commit

Permalink
nr mousescripts, plot gpu stats
Browse files Browse the repository at this point in the history
  • Loading branch information
LeandroTreu committed May 13, 2024
1 parent 0ad5305 commit 49ddf5c
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 0 deletions.
32 changes: 32 additions & 0 deletions mouse_scripts/mousepanning_nr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# Set these according to screen size and element positions
# Find mouse pointer coordinates with "xdotool getmouselocation"
panning_start_x=1010
panning_start_y=600
n_mousemove=20 # Mouse-movements per panning
panning_repetitions=5

# Alt+Tab to the browser window
xdotool key Alt+Tab
sleep 0.5

xdotool mousemove --sync $panning_start_x $panning_start_y
xdotool mousedown 1
for ((j = 0; j < panning_repetitions; j++)); do

for ((i = 0; i < n_mousemove; i++)); do

sleep 0.025
xdotool mousemove_relative --sync 0 20
done
for ((i = 0; i < n_mousemove; i++)); do

sleep 0.025
xdotool mousemove_relative --sync -- 0 -20
done
done
xdotool mouseup 1

# Alt+Tab back to the terminal
xdotool key Alt+Tab
19 changes: 19 additions & 0 deletions mouse_scripts/scroll_nr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Set these according to screen size and element positions
# Find mouse pointer coordinates with "xdotool getmouselocation"
zoom_x=881
zoom_y=674
delay=50 # In ms, between scroll ticks
repetitions=50

# Alt+Tab to the browser window
xdotool key Alt+Tab
sleep 0.5

# Set zoom mouse position
xdotool mousemove --sync $zoom_x $zoom_y
xdotool click --repeat $repetitions --delay $delay 4

# Alt+Tab back to terminal
xdotool key Alt+Tab
81 changes: 81 additions & 0 deletions profile_parser/js/plot_acc_stats.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const nodeplotlib_1 = require("nodeplotlib");
// Scroll
let data = [];
let benchmarks = [];
benchmarks.push({ name: "Un-optimized", values: [25.8, 23.4, 24.0], color: "red" });
benchmarks.push({ name: "Opt. getImageData", values: [49.8, 51.0, 50.4], color: "orange" });
benchmarks.push({ name: "Opt. willReadFrequently", values: [52.2, 52.2, 50.4], color: "orange" });
benchmarks.push({ name: "Opt. GPU default", values: [57.6, 58.2, 58.2], color: "green" });
benchmarks.push({ name: "Opt. GPU desync", values: [60.0, 60.0, 60.0], color: "green" });
for (let i = 0; i < benchmarks.length; ++i) {
const benchmark = benchmarks[i];
let values = benchmark.values;
values.sort((a, b) => a - b);
let y_values = [values[1]];
let bar = {
x: [benchmark.name],
y: y_values,
type: 'bar',
marker: {
color: benchmark.color,
},
name: benchmark.name,
// text: y_values.map(String),
// textposition: "auto",
// hoverinfo: "none",
error_y: {
type: 'data',
symmetric: false,
array: [values[2] - values[1]],
arrayminus: [values[1] - values[0]],
visible: true
},
};
data.push(bar);
}
let layout = {
title: "Zoom FPS Benchmark",
yaxis: { title: "Average FPS", range: [0, 61], dtick: 5 },
};
(0, nodeplotlib_1.plot)(data, layout);
// Panning
data = [];
benchmarks = [];
benchmarks.push({ name: "Un-optimized", values: [17.4, 18.0, 17.4], color: "red" });
benchmarks.push({ name: "Opt. getImageData", values: [25.2, 27.0, 25.8], color: "orange" });
benchmarks.push({ name: "Opt. willReadFrequently", values: [27.0, 24.6, 27.0], color: "orange" });
benchmarks.push({ name: "Opt. GPU default", values: [43.2, 42.0, 43.2], color: "green" });
benchmarks.push({ name: "Opt. GPU desync", values: [40.8, 42.0, 42.0], color: "green" });
for (let i = 0; i < benchmarks.length; ++i) {
const benchmark = benchmarks[i];
let values = benchmark.values;
values.sort((a, b) => a - b);
let y_values = [values[1]];
let bar = {
x: [benchmark.name],
y: y_values,
type: 'bar',
marker: {
color: benchmark.color,
},
name: benchmark.name,
// text: y_values.map(String),
// textposition: "auto",
// hoverinfo: "none",
error_y: {
type: 'data',
symmetric: false,
array: [values[2] - values[1]],
arrayminus: [values[1] - values[0]],
visible: true
},
};
data.push(bar);
}
layout = {
title: "Panning FPS Benchmark",
yaxis: { title: "Average FPS", range: [0, 61], dtick: 5 },
};
(0, nodeplotlib_1.plot)(data, layout);
94 changes: 94 additions & 0 deletions profile_parser/src/plot_acc_stats.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import { plot, Plot } from 'nodeplotlib';

// Scroll
let data: Plot[] = [];
let benchmarks: {name: string, values: number[], color: string}[] = [];

benchmarks.push({name: "Un-optimized", values: [25.8, 23.4, 24.0], color: "red"});
benchmarks.push({name: "Opt. getImageData", values: [49.8, 51.0, 50.4], color: "orange"});
benchmarks.push({name: "Opt. willReadFrequently", values: [52.2, 52.2, 50.4], color: "orange"});
benchmarks.push({name: "Opt. GPU default", values: [57.6, 58.2, 58.2], color: "green"});
benchmarks.push({name: "Opt. GPU desync", values: [60.0, 60.0, 60.0], color: "green"});

for (let i = 0; i < benchmarks.length; ++i) {

const benchmark = benchmarks[i];
let values = benchmark.values;
values.sort((a, b) => a - b);

let y_values = [values[1]];
let bar: Plot = {
x: [benchmark.name],
y: y_values,
type: 'bar',
marker: {
color: benchmark.color,
},
name: benchmark.name,
// text: y_values.map(String),
// textposition: "auto",
// hoverinfo: "none",
error_y: {
type: 'data',
symmetric: false,
array: [values[2]-values[1]],
arrayminus: [values[1]-values[0]],
visible: true
},
};
data.push(bar);
}


let layout = {
title: "Zoom FPS Benchmark",
yaxis: {title: "Average FPS", range: [0, 61], dtick: 5},
}
plot(data, layout);


// Panning
data = [];
benchmarks = [];

benchmarks.push({name: "Un-optimized", values: [17.4, 18.0, 17.4], color: "red"});
benchmarks.push({name: "Opt. getImageData", values: [25.2, 27.0, 25.8], color: "orange"});
benchmarks.push({name: "Opt. willReadFrequently", values: [27.0, 24.6, 27.0], color: "orange"});
benchmarks.push({name: "Opt. GPU default", values: [43.2, 42.0, 43.2], color: "green"});
benchmarks.push({name: "Opt. GPU desync", values: [40.8, 42.0, 42.0], color: "green"});

for (let i = 0; i < benchmarks.length; ++i) {

const benchmark = benchmarks[i];
let values = benchmark.values;
values.sort((a, b) => a - b);

let y_values = [values[1]];
let bar: Plot = {
x: [benchmark.name],
y: y_values,
type: 'bar',
marker: {
color: benchmark.color,
},
name: benchmark.name,
// text: y_values.map(String),
// textposition: "auto",
// hoverinfo: "none",
error_y: {
type: 'data',
symmetric: false,
array: [values[2]-values[1]],
arrayminus: [values[1]-values[0]],
visible: true
},
};
data.push(bar);
}


layout = {
title: "Panning FPS Benchmark",
yaxis: {title: "Average FPS", range: [0, 61], dtick: 5},
}
plot(data, layout);

0 comments on commit 49ddf5c

Please sign in to comment.