mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 15:13:16 +00:00
add my perf script specify hook name for perf data
This commit is contained in:
parent
5d3e99298a
commit
a5d6de8bc8
2 changed files with 14 additions and 1 deletions
|
@ -54,7 +54,7 @@ function ctx.add_hook(hook_name, system_name, fn)
|
||||||
util.tpcall(entry.fn, ...)
|
util.tpcall(entry.fn, ...)
|
||||||
local end_time = GameGetRealWorldTimeSinceStarted()
|
local end_time = GameGetRealWorldTimeSinceStarted()
|
||||||
local delta = (end_time - start_time) * 1000000
|
local delta = (end_time - start_time) * 1000000
|
||||||
ctx.timings = ctx.timings .. entry.system_name .. ":" .. delta .. ","
|
ctx.timings = ctx.timings .. hook_name .. "/" .. entry.system_name .. ":" .. delta .. ","
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
13
scripts/perf.sh
Executable file
13
scripts/perf.sh
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
set -e
|
||||||
|
f=$(cat $1)
|
||||||
|
a=$(echo "$f"|grep "LUA: \["|sed 's/LUA: \[//g;s/].*//;s/ //g'|awk -F',' '{col1 = col1 $1 " "; col2 = col2 $2 " "; col3 = col3 $3 " "} END {print col1; print col2; print col3}'|sed 's/ /,/g;s/,$/}/g;s/^/{/')
|
||||||
|
for b in $a;do
|
||||||
|
echo "{mean$b,standarddeviation$b,max$b,len$b}"|kalc
|
||||||
|
done
|
||||||
|
|
||||||
|
a=$(echo "$f"|grep "LUA: {"|sed 's/LUA: {//g;s/}.*//;s/ //g'|sed 's/,/\n/g'|sort -n)
|
||||||
|
for i in $(echo "$a"|sed 's/:.*//g'|uniq);do
|
||||||
|
b=$(echo {$(echo "$a"|grep "^$i:"|sed 's/.*://g')}|sed 's/ /,/g')
|
||||||
|
echo -ne "$i "
|
||||||
|
echo "{mean$b,standarddeviation$b,max$b,len$b}"|kalc
|
||||||
|
done
|
Loading…
Add table
Add a link
Reference in a new issue