In Firefox with https://perf-html.io you can profile startup time also in Web Workers, by enabling the component "Worker" in the profiling target, and making the sampling buffer size larger and/or the sampling interval a bit more infrequent so that the buffer can contain several seconds/minutes worth of data, instead of its default ~few seconds buffer. That is a good tool that I regularly use for profiling multithreaded asm.js and wasm applications as well, as it can be used to observe/debug performance of coordinated actions between multiple threads.
2018-02-27 20:23 GMT+02:00 Charles Vaughn <[email protected]>: > It would be nice if this was added using the > Performace.mark/Performance.measure API and generally turned on. > > On Wednesday, February 21, 2018 at 3:47:21 PM UTC-8, Alon Zakai wrote: >> >> There are some existing hooks, like Module.onRuntimeInitialized which you >> can start a timer in. See also the BENCHMARK option (search in >> postamble.js), which could perhaps be improved. >> >> On Thu, Feb 15, 2018 at 6:12 PM, awt <[email protected]> wrote: >>> >>> Thanks for your reply Alon :) >>> >>> However, I would like those calls to be in the code permanently so that I >>> can collect startup data even when I'm in production. It seems that I would >>> need to manually edit preamble.js. As far as possible, I hope to keep >>> upstream compatibility with the official repo. >>> >>> Is there a way for me to override specific functions in preamble.js >>> without having to edit the latter? e.g. provide a separate JS file in the >>> --pre-js build flag? >>> >>> On Friday, February 16, 2018 at 3:16:01 AM UTC+8, Alon Zakai wrote: >>>> >>>> Browser profilers and network monitors could help see most of those >>>> things, I think. Otherwise, yeah, Date.now() can be used for others, it >>>> should show up in the console even though it's in a worker. >>>> >>>> On Thu, Feb 15, 2018 at 2:05 AM, awt <[email protected]> wrote: >>>>> >>>>> Hi, >>>>> >>>>> I would like to profile the startup time of my application which uses >>>>> proxy-to-worker. My idea is to measure the time taken to download the wasm >>>>> binary, instantiate it as well as the time taken to run the global >>>>> constructor functions. However, the startup code is embedded in >>>>> preamble.js >>>>> so is there an easy way to inject my measurement calls into the startup >>>>> code? e.g. Date.now() at the relevant places? >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "emscripten-discuss" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> For more options, visit https://groups.google.com/d/optout. >>>> >>>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "emscripten-discuss" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >> >> > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
