News for hackers. Stuff that matters.
Re:Intel Problems by jerf on Tuesday January 19, 2021 @11:20AM (#25834977)
"The vast majority of developers never profile their code."

Protip: New on the job and want to establish a reputation quickly? Find the most common path and fire a profiler at it as early as you can. The odds that there's some trivial win that will accelerate the code by huge amounts is fairly decent.

Another bit of evidence developers rarely profile their code is that I can tell my mental model of how expensive some server process will be to run and most other developer's mental models tend to differ by at least an order of magnitude. I've had multiple conversations about the services I provide and people asking me what my hardware is, expecting it to be run on some monster boxes or something when I tell them it's really just two t3.mediums, which mostly do nothing, and I only have two for redundancy. And it's not like I go profile crazy... I really just do some spot checks on hot-path code. By no means am I doing anything amazing. It's just... as you write more code, the odds that you accidentally write something that performs stupidly badly goes up steadily, even if you're trying not to.

Re:Intel Problems by nicoburns on Tuesday January 19, 2021 @12:19PM (#25835812)
> Find the most common path and fire a profiler at it as early as you can. The odds that there's some trivial win that will accelerate the code by huge amounts is fairly decent.

I've found that a profiler isn't even needed to find significant wins in most codebases. Simple inspection of the code and removal of obviously slow or inefficient code paths can often lead to huge performance gains.

Re:Intel Problems by mattbee on Tuesday January 19, 2021 @02:44PM (#25837872)
I mean I love finding those "obvious" improvements too but how do you know you've succeeded without profiling it? ;)
Re:Intel Problems by foobiekr on Tuesday January 19, 2021 @07:00PM (#25840738)
Every piece of code I’ve looked at in my current job is filled with transformations back and forth between representations.

It’s so painful to behold.

Binary formats converted to JSON blobs, each bigger than my first hard drive (!), and then back again, often multiple times in the same process.