Hacker News new | ask | show | jobs
by bigEnotation 986 days ago
What’s a profiler and how do I start using one?

If they’re language specific, then for typescript, Ruby, and Kotlin.

3 comments

To answer your first question: its software to monitor the execution of a program and produce a mapping from resource usage (usually time-spent) to the source code. This is useful to find the most expensive portions of your application so you can concentrate improvements on them. How exactly to use one would be language-specific, but the general flow is just to loop profiling and addressing problematic code until you're happy with the results. Just gut-checking which exact parts of a program are slow is really hard without prior profiling or very detailed logging (which is a kind of profiling), so they're very important to guide efforts.
For TypeScript (browser, chrome), it should be in the devtools under the Performance tab, (backend) is node --prof and --prof-process
ruby-prof for Ruby and VisualVM or the profiler built into IntelliJ are all pretty good.