#How to profile and optimize?

8 messages · Page 1 of 1 (latest)

lyric obsidian
#

Is there any easy way to profile a JS script using deno? (I am doing adventofcode in typescript using deno and would like to optimize)

clever sonnet
#

you can use --inspect flag and use Chrome Devtools' built-in Profiler

stuck sphinx
#

I recommend inspect-brk over the regular inspect because of the fact that it will wait for input from chromium.

Other than profiling its also a good thing to have benchmarks so verify your changes actually made a impact and by what

clever sonnet
#

or brand new --inspect-wait , it won't break on the first line 😛

stuck sphinx
#

Oh I'm a perf nerd and I didn't even know that one lol

#

What makes it different to brk?

clever sonnet
#

waits for inspector to connect and runs code (doesn't place a breakpoint)