2022-05-20 11:12:32 +00:00
|
|
|
#! /usr/bin/env zsh
|
2022-05-20 07:40:21 +00:00
|
|
|
|
|
|
|
# https://nodejs.org/en/docs/guides/simple-profiling/
|
|
|
|
|
|
|
|
export TS_NODE_COMPILER_OPTIONS='{"module":"commonjs"}'
|
|
|
|
|
|
|
|
rm ./isolate-*-v8.log 2> /dev/null
|
|
|
|
rm ./profiler-output.log 2> /dev/null
|
|
|
|
|
2022-05-20 11:12:32 +00:00
|
|
|
export ELECTRON_RUN_AS_NODE=true
|
|
|
|
alias electron_node=./node_modules/.bin/electron
|
|
|
|
|
2022-05-20 07:40:21 +00:00
|
|
|
echo "running profile.ts"
|
2022-05-20 11:12:32 +00:00
|
|
|
electron_node --require ts-node/register --require tsconfig-paths/register --prof ./scripts/profile.ts
|
2022-05-20 07:40:21 +00:00
|
|
|
|
|
|
|
echo "processing tick file"
|
2022-05-20 11:12:32 +00:00
|
|
|
electron_node --prof-process ./isolate-*-v8.log > ./profiler-output.log && echo "generated profiler-output.log"
|
2022-05-20 07:40:21 +00:00
|
|
|
rm ./isolate-*-v8.log
|