lalitmaganti

Joined 5 years ago

Karma
762
Submissions
109
Member since
Feb 1
Senior Staff Software Engineer at Google working on Perfetto (docs.perfetto.dev). Passionate about open source, performance, and the intersection of the two. Writing about all of these at lalitm.com.
View on Hacker News

Recent submissions

Comment · 1 month ago
Because that would also cause the dependencies to be compiled in series also! The point was only to measure "what if the Bun crate was built in one shot" not any dependencies of Bun.
Comment · 1 month ago
They did not, I did cc Jarred on X but not reached out anything beyond that!
Comment · 1 month ago
There's an open bug for adding macOS support to buildprof: https://github.com/LalitMaganti/buildprof/issues/2

If you mean "how would I implement it without ptrace", there are a few options but likely the Endpoint Security API [1] would be the way to go. But it's not too great because it needs full disk access and root, neither of which I would be particularly happy accepting :(

[1] https://developer.apple.com/documentation/endpointsecurity

Comment · 1 month ago
Yes the whole article is about exactly that :)

You can also use --compiler-traces to understand the inside of the linking process as well; these annotations are provided by lld.

Comment · 1 month ago
> A) Is there any performance penalty on the compiled result due to being optimized in separate pieces

AFAIK, the answer to this is no but only if LTO is doing a good job and actually optimizing well across object files.

> B) If not, why isn't the optimizer smart enough to split them up internally and optimize in parallel?

I think there was another comment by someone more knowledgable in Zig that this is something which is being discussed by the Zig compiler team.

Comment · 1 month ago
Comment · 1 month ago
Comment · 1 month ago
Comment · 1 month ago
Having spent ~3 weeks of evenings and weekends on this, I was a bit burned out to keep trying to optimize especially because all of this code is just a dead end anyway...

The fix seemed to be to split up Bun's Zig module into ~100 pieces just like they've done on Rust but how representative that would have been on anything Bun might of shipped is very much in question!

Comment · 1 month ago
It's actually trivially easy to add a "automated report" feature to buildprof due to its architecture (just a few SQL queries on top of Perfetto's trace processor). And I'm sure AI could hill climb the build time based on this.

But I still think the visual view is invaluable for human understanding and for the "why is this even happening" problems which I think AI is still bad at seeing.

Comment · 1 month ago
Comment · 2 months ago
(author here) I really like your framing here! I think it captures the essence of my thinking in a really concise and coherent way.
Comment · 2 months ago
Thanks for letting me know; I cannot reproduce this myself on my mobile (it should be white text on a dark grey background) but I pushed a speculative fix which might improve things. Please let me know if it helps or, if not, I would love to know more details so I can fix this!

Thanks!

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton