diff --git a/.vscode/launch.json b/.vscode/launch.json index 0ef6f21..4ee0e8e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -179,7 +179,7 @@ // Resolved by CMake Tools: "program": "${command:cmake.launchTargetPath}", - "args": [ "Nam_Profile", "--no-profile","-w" ], + "args": [ "ToobNam_Profile", "--no-profile","-w" ], "stopAtEntry": false, "cwd": "${workspaceFolder}", diff --git a/profiler_tools/.gitignore b/profiler_tools/.gitignore new file mode 100644 index 0000000..81b9e9d --- /dev/null +++ b/profiler_tools/.gitignore @@ -0,0 +1,2 @@ +# profiler out files +*.txt diff --git a/profiler_tools/ToobNam_profile b/profiler_tools/ToobNam_profile index 7c9fef7..c616390 100755 --- a/profiler_tools/ToobNam_profile +++ b/profiler_tools/ToobNam_profile @@ -1,3 +1,3 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -${SCRIPT_DIR}/../build/src/profilePlugin -w ToobNam_Profile -o /tmp/ToobNam.perf &&\ -google-pprof --text ${SCRIPT_DIR}/../build/src/profilePlugin --add_lib /usr/lib/lv2/ToobAmp.lv2/ToobAmp.so /tmp/ToobNam.perf >./ToobNam.txt \ No newline at end of file +${SCRIPT_DIR}/../build/src/profilePlugin -s 100 -w ToobNam_Profile -o /tmp/ToobNam.perf &&\ +google-pprof --text ${SCRIPT_DIR}/../build/src/profilePlugin --add_lib /usr/lib/lv2/ToobAmp.lv2/ToobAmp.so /tmp/ToobNam.perf >./ToobNam.txt diff --git a/profiler_tools/ToobNam_profile_web b/profiler_tools/ToobNam_profile_web new file mode 100755 index 0000000..11671f6 --- /dev/null +++ b/profiler_tools/ToobNam_profile_web @@ -0,0 +1,3 @@ +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +${SCRIPT_DIR}/../build/src/profilePlugin -w ToobNam_Profile -o /tmp/ToobNam.perf &&\ +google-pprof --web ${SCRIPT_DIR}/../build/src/profilePlugin --add_lib /usr/lib/lv2/ToobAmp.lv2/ToobAmp.so /tmp/ToobNam.perf >./ToobNam.txt diff --git a/profiler_tools/nam_profile b/profiler_tools/nam_profile index 9654887..5f24cc1 100755 --- a/profiler_tools/nam_profile +++ b/profiler_tools/nam_profile @@ -1,3 +1,3 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -${SCRIPT_DIR}/../build/src/profilePlugin -w Nam_Profile -o /tmp/nam.perf &&\ -google-pprof --text ${SCRIPT_DIR}/../build/src/profilePlugin --add_lib /usr/lib/lv2/neural_amp_modeler.lv2/neural_amp_modeler.so /tmp/nam.perf >./nam.txt \ No newline at end of file +${SCRIPT_DIR}/../build/src/profilePlugin -s 100 -w Nam_Profile -o /tmp/nam.perf &&\ +google-pprof --text ${SCRIPT_DIR}/../build/src/profilePlugin --add_lib /usr/lib/lv2/neural_amp_modeler.lv2/neural_amp_modeler.so /tmp/nam.perf >./nam.txt diff --git a/profiler_tools/nam_profile_web b/profiler_tools/nam_profile_web new file mode 100755 index 0000000..70827d4 --- /dev/null +++ b/profiler_tools/nam_profile_web @@ -0,0 +1,3 @@ +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +${SCRIPT_DIR}/../build/src/profilePlugin -w Nam_Profile -o /tmp/nam.perf &&\ +google-pprof --web ${SCRIPT_DIR}/../build/src/profilePlugin --add_lib /usr/lib/lv2/neural_amp_modeler.lv2/neural_amp_modeler.so /tmp/nam.perf >./nam.txt diff --git a/src/profilePluginMain.cpp b/src/profilePluginMain.cpp index d34acdc..e75eff4 100644 --- a/src/profilePluginMain.cpp +++ b/src/profilePluginMain.cpp @@ -153,6 +153,10 @@ void profilePlugin(const ProfileOptions &profileOptions) RingBufferSink ringBufferSink(writerRingbuffer); + + // run once to get memory allocations in NAM and ML out of the way. + lv2Pedalboard->Run(inputBuffers, outputBuffers, nFrames, &ringBufferWriter); + /* *** Pump the plugin for a bit if it is expected to do work on the scheduler thread when initializing */ if (profileOptions.waitForWork) {