Live data from Hacker News

Simple Code, High Performance [video]

youtube.com

61–70 of 86 posts

Re: Simple Code, High Performance [video]

#61
post #34

Earlier quoted context omitted.

> We have computers which are ridiculous fast, but tend to write code which is freaking slow. It's sad that most programs could be 100x faster. I feel this sort of comment misses the whole point of going with code which is patently slower than alternatives. The main reason is that performance is a constraint but not a goal, and once it is good enough then there is absolutely nothing to be gained by wasting time on se…

Meanwhile, the main resource in software development is man hours. The faster you write software (add features, fix bugs, etc) the cheaper it is.* People have argued that developer time is the most precious resource since forever. In more recent times, people have also argued that pushing new features needs to happen as quickly as possible, particularly in the context of web and mobile apps. I am rather sceptical abo…

I agree with you in general, but O(n²) is always dangerous. Perhaps this example you give is a little to the extreme.

Writing slow software is also a form of waste. Then it becomes a question of ranking waste and getting rid of the most wasteful, according to a cost/benefit ratio, but waste is never a good thing to tolerate in any cultural sense.

Re: Simple Code, High Performance [video]

#62

Earlier quoted context omitted.

How exactly is readability made up?

This is a good question to ask, if not rhetorical. When practicing rigorous measuring, quantities need to be quantifiable aspects of the world. For example, you can quantify how much physical space your code or compiled output takes up in memory, and use these quantities as base units to derive others. By branching from a quantifiable root, you can derive metrics such as lines of code or number of CPU instructions, a…

> Needless to say, readability, as a metric, is not branched from quantifiable aspects of the world. So in a sense, it is still a “made up” metric because (as of today), there’s no way to trace it down to the quantifiable measurements.

It is, actually. "Readability" for me means "how long it takes to someone that didn't write the code to be able to understand it, make changes, add features". It's a more fuzzy metric of course, as anything involving humans is, but that's also usually the kind of metrics that matters a lot.

That also means that it's not a binary readable/non-readable thing. A way of measuring "readability" could be: assuming all other variables are equal, what percentage of the new hires are able to add new features after 1 month?

Re: Simple Code, High Performance [video]

#63
post #47

I wonder how much performance is gained by having the code written by just one person. At work we have a reasonably large (16 MLOC) codebase. At this point I don't think it's possible for one person to do everything, especially while adding new features. So what we do is that we create relatively clean interfaces, and have people code mostly inside those interfaces. But every time we go through one of those interface…

In this case: nothing.

The fast renderer was written by one person in a few days. It's clearly a "few thousand loc" codebase, not "millions loc".

The 100x slower renderer was also written by one person (or at most few).

It really is the difference between programmers.

It's also a good example that 10x programmers do exist, at least in certain situations.

The Microsoft programmers are not dumb. They certainly are not cheap.

And yet here we have one guy who can write code that is 10-100x faster, in just few days.

Re: Simple Code, High Performance [video]

#64
post #63
post #47

I wonder how much performance is gained by having the code written by just one person. At work we have a reasonably large (16 MLOC) codebase. At this point I don't think it's possible for one person to do everything, especially while adding new features. So what we do is that we create relatively clean interfaces, and have people code mostly inside those interfaces. But every time we go through one of those interface…

In this case: nothing. The fast renderer was written by one person in a few days. It's clearly a "few thousand loc" codebase, not "millions loc". The 100x slower renderer was also written by one person (or at most few). It really is the difference between programmers. It's also a good example that 10x programmers do exist, at least in certain situations. The Microsoft programmers are not dumb. They certainly are not…

I don't think that's exactly true. It's not the same thing to write a piece of code as part of a whole system, vs rewriting that piece of code as an isolated part.

> The 100x slower renderer was also written by one person (or at most few).

The difference between one person and a few is massive in my experience.

> It really is the difference between programmers.

> It's also a good example that 10x programmers do exist, at least in certain situations.

> The Microsoft programmers are not dumb. They certainly are not cheap.

> And yet here we have one guy who can write code that is 10-100x faster, in just few days.

I think it's a difference between incentives too. Microsoft programmers are not here to optimize for performance, but to push features, performance being one of them in some cases. For example, the research in file explorer is still painfully slow, probably because they have some other things to do. Many people could make it faster in a few days I guess. But these people aren't inside Microsoft being pressured to do other things.

Software made to demonstrate how fast something can be is made in a very different environement and with very different incentives compared to almost all comercial software. For pretty much anything out there, someone can take it, isolate it and make it run 10-100x times faster I think. The thing is, in most organizations you don't have that kind of time.

Re: Simple Code, High Performance [video]

#65
post #64
post #63

Earlier quoted context omitted.

In this case: nothing. The fast renderer was written by one person in a few days. It's clearly a "few thousand loc" codebase, not "millions loc". The 100x slower renderer was also written by one person (or at most few). It really is the difference between programmers. It's also a good example that 10x programmers do exist, at least in certain situations. The Microsoft programmers are not dumb. They certainly are not…

I don't think that's exactly true. It's not the same thing to write a piece of code as part of a whole system, vs rewriting that piece of code as an isolated part. > The 100x slower renderer was also written by one person (or at most few). The difference between one person and a few is massive in my experience. > It really is the difference between programmers. > It's also a good example that 10x programmers do exist…

Looks like you dont now the full story behind it. But there is quite a back story to this.

The guy in video called what your doing now "the excuse parade".

Instead of finding solutions, your time and energy goes into making excuses.

Watch the full video.

Re: Simple Code, High Performance [video]

#66
post #64
post #63

Earlier quoted context omitted.

In this case: nothing. The fast renderer was written by one person in a few days. It's clearly a "few thousand loc" codebase, not "millions loc". The 100x slower renderer was also written by one person (or at most few). It really is the difference between programmers. It's also a good example that 10x programmers do exist, at least in certain situations. The Microsoft programmers are not dumb. They certainly are not…

I don't think that's exactly true. It's not the same thing to write a piece of code as part of a whole system, vs rewriting that piece of code as an isolated part. > The 100x slower renderer was also written by one person (or at most few). The difference between one person and a few is massive in my experience. > It really is the difference between programmers. > It's also a good example that 10x programmers do exist…

It's funny because Casey made this video partly to push back on people like you who come up with limitless excuses for why slow code is "actually the right way to do it".

I guess it didn't work.

Are you really arguing that the code is 10-100x slower because it was written by 2 people and not one?

And if the reason we write slow code is to save programmer time, as your other argument goes, why is it ok to put 2 people to write code that can be written by 1 guy?

That excuse doesn't make it better, it just makes it look doubly bad for Microsoft. Not only they can't write fast code, they spend twice as much time doing so!

Re: Simple Code, High Performance [video]

#68
post #66
post #64

Earlier quoted context omitted.

I don't think that's exactly true. It's not the same thing to write a piece of code as part of a whole system, vs rewriting that piece of code as an isolated part. > The 100x slower renderer was also written by one person (or at most few). The difference between one person and a few is massive in my experience. > It really is the difference between programmers. > It's also a good example that 10x programmers do exist…

It's funny because Casey made this video partly to push back on people like you who come up with limitless excuses for why slow code is "actually the right way to do it". I guess it didn't work. Are you really arguing that the code is 10-100x slower because it was written by 2 people and not one? And if the reason we write slow code is to save programmer time, as your other argument goes, why is it ok to put 2 people…

> It's funny because Casey made this video partly to push back on people like you who come up with limitless excuses for why slow code is "actually the right way to do it".

I'm not saying it's "actually the right way to do it", I'm saying that it's how it's done in real life. That kind of argument reminds me a lot of Robert Martin that is always saying that the fix to software is to have everyone be more disciplined. It's true but it's also absolutely useless. It's like saying "people should be less mean to each other". Yes, they should, we've been saying that for thousands of years. Does that come with anything? A new tool to show how fast your code can be? It's nice to show to people how fast the code can go, especially since the students didn't seem to think that it was possible. But then what?

> And if the reason we write slow code is to save programmer time, as your other argument goes, why is it ok to put 2 people to write code that can be written by 1 guy?

You measure time in man hours, not just in men.

Re: Simple Code, High Performance [video]

#69
post #65
post #64

Earlier quoted context omitted.

I don't think that's exactly true. It's not the same thing to write a piece of code as part of a whole system, vs rewriting that piece of code as an isolated part. > The 100x slower renderer was also written by one person (or at most few). The difference between one person and a few is massive in my experience. > It really is the difference between programmers. > It's also a good example that 10x programmers do exist…

Looks like you dont now the full story behind it. But there is quite a back story to this. The guy in video called what your doing now "the excuse parade". Instead of finding solutions, your time and energy goes into making excuses. Watch the full video.

> The guy in video called what your doing now "the excuse parade".

> Instead of finding solutions, your time and energy goes into making excuses.

Excuses for what exactly? I don't remember writing that code. I'm explaining incentives that leads to slow code. I usually try to write the best code I can in the time I have, but if one day the problem is that my code is too slow, I won't be making excuses. I chose at the time to not spend very much time on performance to ship faster, and that was a conscious choice on my part.

Re: Simple Code, High Performance [video]

#70

That's exactly how i managed to enhance the performance of my site. https://vashishthakapoor.com/ Keeping the features along with performance is a big challenge. Video is really explainatory to fix performance issues.

Wow, your site is indeed fast. Good job!

Thank you so much mate. Means a lot. :)
Post reply on HN