Add a "performance-scripts" package that can hook into most exported js functions and wrap profile generating logic around them. Currently all environment variable driven, explaining misusage and exiting immediately if you forget some.
Currently supported profile types are iTwin.js iModel sqlite profiling, linux perf profiling, JavaScript CPU profiling.
This allows you to do the following examples in this repo:
cd packages/test-app/
# profile the targetDb sqlite statements in the test app
PROFILE_TYPE=sqlite \
NODE_OPTIONS='-r ../performance-scripts' \
FUNCTIONS='require("./lib/Transformer").Transformer.transformAll' \
ARG_OFFSETS=1 \
node lib/Main.js \
--sourceFile /tmp/samples/house_model.bim \
--targetDestination /tmp/out.bim
# or separately profile both processAll and processSchemas native code performance with linux perf
PROFILE_TYPE=linux-perf \
NODE_OPTIONS='-r ../performance-scripts --perf-basic-prof --interpreted-frames-native-stack' \
FUNCTIONS='require("@itwin/imodel-transformer").IModelTransformer.prototype.processAll,require("@itwin/imodel-transformer").IModelTransformer.prototype.processSchemas'
sudo node lib/Main.js \
--sourceFile /tmp/samples/house_model.bim \
--targetDestination /tmp/out.bim
# or processSchemas js profile
PROFILE_TYPE=js-cpu \
NODE_OPTIONS='-r ../performance-scripts' \
FUNCTIONS='require("@itwin/imodel-transformer").IModelTransformer.prototype.processSchemas'
node lib/Main.js \
--sourceFile /tmp/samples/house_model.bim \
--targetDestination /tmp/out.bim
Add a "performance-scripts" package that can hook into most exported js functions and wrap profile generating logic around them. Currently all environment variable driven, explaining misusage and exiting immediately if you forget some.
Currently supported profile types are iTwin.js iModel sqlite profiling, linux perf profiling, JavaScript CPU profiling.
This allows you to do the following examples in this repo: