summaryrefslogtreecommitdiff
path: root/scripts/perf
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/perf')
-rwxr-xr-xscripts/perf/frame_profile43
-rw-r--r--scripts/perf/profile_cmp.py5
2 files changed, 46 insertions, 2 deletions
diff --git a/scripts/perf/frame_profile b/scripts/perf/frame_profile
new file mode 100755
index 0000000000..84eb1166d5
--- /dev/null
+++ b/scripts/perf/frame_profile
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+
+exe="$1"
+
+if [[ -z "$exe" ]]
+then
+ # this script lives in scripts/perf
+ base="$(dirname "$0")/../.."
+ case $OSTYPE in
+ darwin*)
+ # Don't assume a build type (e.g. RelWithDebInfo). Collect all of
+ # both, and pick the most recent build.
+ exe="$(ls -t "$base"/build-darwin-x86_64/newview/*/"Second Life"*.app/Contents/MacOS/"Second Life"* | head -1)"
+ ;;
+
+ cygwin)
+ exe="$(ls -t "$base"/build-*/newview/*/secondlife-bin.exe | head -1)"
+ ;;
+
+ linux-gnu)
+ exe="$(ls -t "$base"/build-linux-*/newview/packaged/secondlife | head -1)"
+ ;;
+
+ *)
+ stderr "Unknown platform $OSTYPE"
+ exit 1
+ ;;
+ esac
+fi
+
+if [ -z "$exe" ]
+then stderr "No viewer package build found"
+ exit 1
+fi
+
+# If a Mac user specified the .app bundle itself, dig in for the executable.
+if [[ "$OSTYPE" == darwin* && -d "$exe" && "$exe" == *.app ]]
+then
+ exe="$(ls "$exe/Contents/MacOS/Second Life "*)"
+fi
+
+"$exe" --autologin --luafile 'frame_profile_quit.lua 228 232 26' \
+ http://maps.secondlife.com/secondlife/Bug%20Island/220/224/27
diff --git a/scripts/perf/profile_cmp.py b/scripts/perf/profile_cmp.py
index 9dbfa3145b..34281b8d01 100644
--- a/scripts/perf/profile_cmp.py
+++ b/scripts/perf/profile_cmp.py
@@ -60,8 +60,9 @@ def compare(baseline, test, epsilon=DEFAULT_EPSILON):
if abs(delta) > epsilon:
deltas.append((delta, shader, bthruput, tthruput))
- # descending order of performance gain
- deltas.sort(reverse=True)
+ # ascending order of performance gain: put the most egregious performance
+ # hits at the top of the list
+ deltas.sort()
print(f'{len(deltas)} shaders showed nontrivial performance differences '
'(millon samples/sec):')
namelen = max(len(s[1]) for s in deltas) if deltas else 0