frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Profiling with Ctrl-C (2024)

https://yosefk.com/blog/profiling-with-ctrl-c.html
91•hun3•1d ago

Comments

dzdt•1d ago
The first footnote here had me cackling aloud. Don't miss the footnotes!
Brian_K_White•1d ago
The very similar "stepped in it" definitely has the same connotation in English.

But it needs the "it". "step in" alone or in any context where "it" isn't a mystery doesn't do it.

"step into the function" or "step into the hallway" doesn't do it even slightly.

The opposite even. In the case of "step into the hallway" where "step" does actually refer to literally using ones feet, saying step is a bit more sophisticated option for something like walk or go, invoking a sense of dancing vs merely relocating. So the "step in" is actually more elegant and tasteful.

Stepping into into or through a function doesn't invoke any dancing, merely the non-continuous, non-analog nature of the process.

But "here's where we stepped in it" has exactly the image and meaning he means.

Perhaps there is some other word in Russian that would do a better job of expressing something that proceeds in hard jumps? Maybe "step" was always just a too-literal translation from English or other languages because there is obviously a Russian word for "step"?

Is the 90-degree shape of stair called a step in Russian? Were instructions called steps in Russian before the western world put our own words for computer stuff into everyone else's languages overnight? Would a 400 year old document describe the recipe for a soup as a set of steps? In that case "step" was not merely a too-literal translation.

lelandfe•1d ago
"I stepped into a management role. Then I had to scrape it off my shoes."
ahartmetz•1d ago
Sure, it's a fine technique if essentially one thing is consuming all the CPU time (and it shouldn't), which does happen. It becomes tedious when you're looking for the thing that consumes 20% or so of the CPU time.
vjvjvjvjghv•1d ago
Yes, this method is probably fine for finding the one big offender. But you quickly reach a point where you see 5% here and 5% there. Then you need a real profiler.
layer8•1d ago
Luckily the article discusses that.
silon42•1d ago
Once upon a time (maybe even before pthreads) I made an automatic version of this using SIGALARM for profiling.

I made a wrapper (using LD_PRELOAD) around XSelectInput that would trigger the signal 0.1 seconds after a keyboard/mouse (or other event) was received... Then it would dump stack traces every 0.1 seconds where "slow" UI code was being executed (before next call to XSelectInput).

incanus77•1d ago
I kind of do a variant of this sometimes with “pause” in the Xcode debugger. If I’ve just encountered some kind of hang or delay, often hitting that will put me in the right place in the threads/call stack to figure out what I did.
maccard•1d ago
> Which goes to show that Ctrl-C profiling is often enough to solve a simple problem, and it’s usually much easier than learning how to use a profiler and how to properly read its output

As the article says, this is a low frequency sampling profiler, which means it comes with all the caveats of a sampling profiler, and interpreting its output. As a very crude tool, sure, but it is not an excuse to not learnt to use a profiler. Perf, instruments and UIForETW are simple enough to use that anyone who can follow the instructions in this blog past can pick up the basics in the same length of time.

eichin•1d ago
This is interestingly analogous to nelhage's memory sampling approach https://blog.nelhage.com/2013/03/tracking-an-eventmachine-le... where if something is leaking "at scale", let it - then gcore it, and pick a random page of the core and see what's there. (An even cheaper variant I've used a few times with python is to just run "strings | sort | uniq -c | sort -n" on the core, so you get the most common strings which are usually part of object metadata and give you a solid hint without needing to go in with a debugger...) The ^C approach basically samples time instead of memory.
tialaramex•1d ago
Substantially pre-dated by e.g. Raymond Chen's explanation

https://devblogs.microsoft.com/oldnewthing/20050815-11/?p=34...

and by my implementation (for Linux) https://github.com/tialaramex/leakdice-rust or https://github.com/tialaramex/leakdice if you can't use Rust)

nvartolomei•1d ago
Wrap gdb in a shell script and you’ve got yourself an actual profiler: https://poormansprofiler.org/
baruch•1d ago
Ages ago, working on an embedded system we did something similar by running gdb server on the embedded machine and gdb on the server and running a script to collect periodic stack traces to get a sampling profiler.

Footprints in the Sand

https://twitter.com/iruletheworldmo/status/2007538247401124177
1•cpr•46s ago•0 comments

15 Years at XING – Reflections and a Farewell

https://www.stefanimhoff.de/15-years-xing/
1•Aldipower•1m ago•0 comments

Gramsci's Warning (2025)

https://www.insidehighered.com/opinion/columns/higher-ed-gamma/2025/03/17/old-world-dying-and-new...
1•robtherobber•4m ago•0 comments

Tell HN: EU soliciting feedback on law that could affect Open Access

2•Quanttek•9m ago•0 comments

Connecting portfolios, ATS, AI to simplify startup hiring

1•kathir05•10m ago•1 comments

Clawdbot Personal AI Assistant

https://clawdbot.com/
1•tobi_bsf•10m ago•0 comments

How to Do Great Work

https://paulgraham.com/greatwork.html
1•Anon84•10m ago•0 comments

AI Systems Engineering Patterns

https://blog.alexewerlof.com/p/ai-systems-engineering-patterns
1•weltview•14m ago•0 comments

List of Web Archiving Initiatives

https://en.wikipedia.org/wiki/List_of_web_archiving_initiatives
1•frozenseven•14m ago•0 comments

Either micromanage your people or lean on them

https://betterthanrandom.substack.com/p/either-micromanage-your-people-or
1•weltview•15m ago•0 comments

The Internet Was Built for Humans. Now It's for Agents

https://chiefting.substack.com/p/the-internet-was-built-for-humans
2•mpraz•22m ago•0 comments

Ghost Archive

https://ghostarchive.org/
1•frozenseven•26m ago•0 comments

Paris court finds 10 guilty of cyberbullying France's first lady Brigitte Macron

https://apnews.com/article/brigitte-macron-ruling-cyberbullying-france-5f78de63dc14f765e509a00400...
1•perihelions•26m ago•0 comments

Delta Electronics: Taiwan's Power Supply Giant [video]

https://www.youtube.com/watch?v=nRKxKz2eiOo
1•mgh2•29m ago•0 comments

Who Owns the Memory? Part 1: What Is an Object?

https://lukefleed.xyz/posts/who-owns-the-memory-pt1/
1•lalitmaganti•30m ago•0 comments

Perfect and Imperfect Shuffles

https://www.johndcook.com/blog/2026/01/01/perfect-shuffles/
1•ibobev•30m ago•0 comments

In-Shuffles and Out-Shuffles

https://www.johndcook.com/blog/2026/01/01/in-shuffle-out-shuffle/
1•ibobev•30m ago•0 comments

Freestyle Linked Lists Tricks

https://nullprogram.com/blog/2025/12/31/
1•ibobev•31m ago•0 comments

Ask HN: What kind of side projects are you working on?

2•chistev•32m ago•0 comments

We Come to Know Earth

https://www.quantamagazine.org/how-we-came-to-know-earth-20250915/
2•nsoonhui•32m ago•0 comments

A Woman Who Predicted Tech Fascism – Paulina Borsook Was Right

https://www.youtube.com/watch?v=DL-kwZdkiOA
3•rasengan0•36m ago•0 comments

Show HN: A tiny tool that creates short business snapshots

https://frabjous-sundae-f249f4.netlify.app/
1•RafalPilla•36m ago•0 comments

Everything You Need to Know About Email Encryption in 2026

https://soatok.blog/2026/01/04/everything-you-need-to-know-about-email-encryption-in-2026/
2•tempodox•37m ago•0 comments

8bitDo Reveals Flip-Style iPhone Controller for Portrait Mode Gaming

https://www.macrumors.com/2026/01/05/8bitdo-iphone-controller-portrait-gaming/
1•tosh•37m ago•0 comments

Adolf Hitler: Man of the Year, 1938 (1938)

https://time.com/archive/6598257/adolf-hitler-man-of-the-year-1938/
2•chistev•38m ago•0 comments

The text mode lie: why modern TUIs are a nightmare for accessibility

https://xogium.me/the-text-mode-lie-why-modern-tuis-are-a-nightmare-for-accessibility
1•robin_reala•41m ago•0 comments

Anna's Archive Loses .Org Domain After Surprise Suspension

https://torrentfreak.com/annas-archive-loses-org-domain-after-surprise-suspension/
31•CTOSian•45m ago•4 comments

Visualizing neural network inference in 3D with WebGL and ONNX

https://www.erikjs.com/blog/building-neural-network-visualizer
1•csgod•45m ago•0 comments

The Next Two Years of Software Engineering

https://addyosmani.com/blog/next-two-years/
1•headalgorithm•45m ago•0 comments

John Horton Conway: the most charismatic mathematician (2015)

https://www.theguardian.com/science/2015/jul/23/john-horton-conway-the-most-charismatic-mathemati...
2•thunderbong•46m ago•0 comments