Hacker News new | ask | show | jobs
by FarmerPotato 2 hours ago
Do you think the author is somehow capable of writing the entire codebase, but not able to reason about code???

I'm sure you've never made a silly mistake where you passed the wrong integer parameter to a function, stared at your screen, and failed to notice it. Or, forgot the order of arguments to calloc().

If you're saying that profiling is for those too lazy to reason about their code, you're distorting the whole lesson: profiling is more powerful than guessing.

5 comments

I make all sorts of silly mistakes, but I'd rarely say that running the code is the only way to detect issues.

I also don't think the author wrote much of their codebase, or much of their blog post, but that's the brave new world we're living in.

The author didn't write the blog post so my default assumption is they didn't write the code either.
I'm called in to consult on a performance problem on a scaled service. Team was load testing their code and seeing low throughput:

Me: so you have an in-memory cache, right?

Them: yes!

Me: what is the TTL?

Them: Oh, it's not set, oops. Here, let's set it to 1 minute. Hey look, the performance went way up!

Me: okay, great. When you say 1 minute, do you mean 60 seconds?

Them: uh...wait...uh....oh, the unit is seconds. Wait, why is the performance so good with a 1 second TTL?

Me: What's your load test?

Them: We crank 1M TPS fetching the same 30 items over and over.

Me: ....

I totally agree about the power of profiling but profiling without understanding would not have helped this team.

So the author is doing a self-learning exercise about profiling pre-production code, and you're disagreeing with them by comparing it to a commercial contract. I'm sure you've never, ever made a dumb mistake while getting paid.
I've even made dumb mistakes while NOT getting paid. But even so, I have no idea what you're talking about.
No, that's not the point. This isn't a situation where you need to "guess"; bloom filters should be sized according to their capacity. This is akin to having a fixed 10-arg buffer for your program, getting a crash when someone passes 11, and saying "this is the kind of bug you only find by building the thing and measuring it". Yeah it happens and we all make silly mistakes, but it's just not true that this couldn't have been foreseen.
Cool! My first downvote!