I see, well I've never performed any benchmark but it's quite possible that an ad hoc headless browser performs better for what concerns repeated tests. On the other hand, in this case you're instrumenting a real (really employed by the final user) browser. Possibly things will improve with this new headless mode for Chrome.
In any case this JavaScript module should not introduce any performance degradation, but if it does and you happen to give it a try in the future, feel free to open an issue.
Yes, including "prof.h" is enough, but you can try using different events, by default Prof uses `PERF_COUNT_HW_REF_CPU_CYCLES`. For example try defining before #include "prof.h":
#define PROF_EVENT_LIST PROF_EVENT_HW(CPU_CYCLES)
or
#define PROF_EVENT_LIST PROF_EVENT_SW(CPU_CLOCK)
Which kernel version are you running?
Are you running this from a virtual machine?