Earlier quoted context omitted.
He measures code 'simplicity' by how much work it makes CPU do, and not some made up metric like 'readability'.
How exactly is readability made up?
Simple Code, High Performance [video]
31–40 of 86 posts
Re: Simple Code, High Performance [video]
#32We 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.
Re: Simple Code, High Performance [video]
#33Earlier 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…
[0] https://tomasvotruba.com/blog/2018/05/21/is-your-code-readab...
Re: Simple Code, High Performance [video]
#34I love these videos, it's the kind of no BS programming to press performance on modern computers. Also recommend the Handmade Hero series of him. 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 seeking performance gains.
Meanwhile, the main resource in software development is man*hours. The faster you write software (add features, fix bugs, etc) the cheaper it is. Thus, software projects benefit the most by adopting and using technology which favour turnaround time, which means higher-level languages, generic full-featured frameworks, and code reuse. They are slow and bloated and not optimized, and they are used without optimization in mind. But they work and they work acceptably.
Your client and project manager does not care if you go with a O(n2) implementation that you can whip out right now by reusing a package and has acceptable performance even if there is a O(n) alternative that requires you a few weeks to implement and forces you to test, debug, and maintain a lower level implementation.
Performance is meaningless once it's good enough. It matters nothing if your browser wastes 1GB of RAM even though it could just use 100MB because practically everyone already has 8GB to begin with, and if would be foolish to waste resources prioritizing that if no one is willing to pay for that improvement. It matters nothing if your server has a relatively low throughput because it is wasting 10s of milliseconds doing nothing in each response if all your servers barely break 50% utilization. It matters nothing if your frontend is wasting 10s of milliseconds rendering a page if end users don't even notice any delay. If performance is good enough, work is focused on where it matters.
We know it's possible to get formula1-level performance by using formula1-level of engineering and maintenance, but the world runs on Volkswagen hatchbacks.
Re: Simple Code, High Performance [video]
#35I love these videos, it's the kind of no BS programming to press performance on modern computers. Also recommend the Handmade Hero series of him. 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.
> 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…
See John Carmack on Inlined Code: http://number-none.com/blow/blog/programming/2014/09/26/carm...>
Re: Simple Code, High Performance [video]
#36Earlier quoted context omitted.
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…
I’d note that because something is hard to measure doesn’t make it “made-up” or unimportant. And that concentrating on things that are easy to measure doesn’t make them more important and in fact can bias things badly.
Re: Simple Code, High Performance [video]
#37I love these videos, it's the kind of no BS programming to press performance on modern computers. Also recommend the Handmade Hero series of him. 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.
> 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…
Re: Simple Code, High Performance [video]
#38Earlier quoted context omitted.
How exactly is readability made up?
Simple example: I love the ternary operator and use it quite a lot in simple "if/then" scenarios. However some people hate them because they consider them harder to read than the fully written out if/then form. Those people would judge my code less readable.
Re: Simple Code, High Performance [video]
#39I love these videos, it's the kind of no BS programming to press performance on modern computers. Also recommend the Handmade Hero series of him. 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.
> 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…
Re: Simple Code, High Performance [video]
#40Earlier 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…
“Good enough” is defined by the inability of stakeholders to conceive of transitive benefits. Compute performance suffers the tragedy of the commons.
The whole point is that there are absolutely no benefits, at least relevant ones, once the performance is acceptable. It's a diminishing returns game. There is always a tradeoff between performance and cost, and once performance is acceptable then it's hard to justify wasting more resources to get nothing of value in return.