正在加载视频...

视频加载失败

Couldn't agree more with Linus here. Making your code running as fast as possible (or just faster than someone's else code) is the best feeling you can get from programming The issue that it is extremely hard to find the project that will pay you for instruction level efficiency

417,175 次观看 • 1 年前 •via X (Twitter)

43 条评论

Hyperdimensional Hegelian Chaos Giga Wizard™️ 的头像
Hyperdimensional Hegelian Chaos Giga Wizard™️1 年前

He’s absolutely right, this is probably my favorite part about coding. Here’s something I use all the time, I just did a quick example. I’m on my iPhone, so I just pulled a quick example from GPT to show a simple example of autism in this regard. Apples-to-apples example that reliably speeds up: apply a gain and bias to a big float buffer and clamp to [0,1]. That’s math-heavy enough to benefit from SIMD and uses only primitive buffers (so ARC overhead doesn’t get in the way). It’s a lot of fun. This is just simple objective-C in iOS.

Hyperdimensional Hegelian Chaos Giga Wizard™️ 的头像
Hyperdimensional Hegelian Chaos Giga Wizard™️1 年前

That’s right

Himanshu Kumar 的头像
Himanshu Kumar1 年前

Optimization offers deep satisfaction, but maintainability is often a more valuable skill. Faster code isn't always better code.

Dmitriy Kovalenko 的头像
Dmitriy Kovalenko1 年前

Maintability is a myth. Show me any of the code you write and I will seriously say this is unmaintable piece of shit - I need 2 month to rewrite it. And I will be right. Speed is measurable. Faster code is always better.

mr_alega 的头像
mr_alega1 年前

@codewithimanshu And yet some code is less unmaintainable than other

Dmitriy Kovalenko 的头像
Dmitriy Kovalenko1 年前

@codewithimanshu Let me guess: the code you write is so much more maintainable than the code written by other people?

network_pun 的头像
network_pun1 年前

@mr_alega @codewithimanshu "the size of change required to implement a feature" isn't measurable? you can't count the lines of code changed in a PR? Or count the days it took to get it done? Or the quantity/duration of outages from things breaking?

Dmitriy Kovalenko 的头像
Dmitriy Kovalenko1 年前

I can count. And I deliberately saying that it is worth to trash away any code you write because my code I will write instead of yours 1. Will have less lines of code changed in the next prs 2. Will take less days to get anything done 3. Will take less time to debug and fix the outage And the funnies part this is going to be true. I hope you get the point

PlusJamais 的头像
PlusJamais1 年前

Only finance can pay for this level efficiency, or military I think. Even IA is shit level efficiency.

Dmitriy Kovalenko 的头像
Dmitriy Kovalenko1 年前

I doubt very much that finance that runs the world in Java is interested in paying the money. For corporates like jane street correctness will be always > perf

Jules 的头像
Jules1 年前

The essential problem is that as efficiency goes up; extensibility usually goes down.

Mark Best 的头像
Mark Best1 年前

I always love solving problems in a neat and succinct way. Like a DP solution to something that would otherwise be a nightmare.

Robert Keyes 的头像
Robert Keyes1 年前

In times past, I would write code that was tight, fast, and with as few dependencies as possible. I wish those skills had some value these days. Maybe somewhere in the embedded space they do.

DJ Goosen 的头像
DJ Goosen1 年前

A micro-optimization of any program with many millions of copies running globally isn't a micro-optimization at all

Cornelis van der Bent 的头像
Cornelis van der Bent1 年前

Once organised a speed coding challenge at work: Space Research Organisation Netherlands. A university intern and I competed. Goal was to combine adjacent pixels in an X-ray camera image. In C of course. For over a week every morning we compared results. Crazy how much speed can be improved if you focus on it. We had completely different algorithms: I fiddled linked lists and had a custom memory pool: a linked list that was constructed at compile time (as one of the crazy optimisations). My contender used a more traditional approach with arrays. We ended very close; both thought the other guy had won.

Ben Hayes 🎿⛵️ 的头像
Ben Hayes 🎿⛵️1 年前

Gaming, HFT, exchanges, sell side trading

shek 的头像
shek1 年前

Several such open source opportunities available on @solana

USGC 的头像
USGC1 年前

Based and @FFmpeg pilled.

Porventura 的头像
Porventura1 年前

"I sometimes think we ought to hang one over every programmer's desk (or around their neck) so they know what they're throwing away when they throw away microseconds."

Alexander 的头像
Alexander1 年前

Dont need to worry about speed of searching the Filesystem, if you dont search the Filesystem 🤣

Geoff Langdale 的头像
Geoff Langdale1 年前

I was lucky in being able to work on this type of code for a couple decades (Hyperscan, which does high performance regex matching, is a "load bearing" codebase in a lot of security stacks - slow scanning means slow packets). Not everyone loves this particular feeling but I do!

FixTechStuff 🛠️ 的头像
FixTechStuff 🛠️1 年前

@hansfbaier Absolutely. Modern computers should be running thousands of times faster than they do. Unfortunately bloated software drives the entire hardware industry.

𝕬𝖑𝖕𝖍𝖆 𝕷𝖊𝖌𝖎𝖔𝖓 🕋 的头像
𝕬𝖑𝖕𝖍𝖆 𝕷𝖊𝖌𝖎𝖔𝖓 🕋1 年前

That’s why I’m an embedded software guy. My code is 10000000x more efficient than 99.99 percent of pc coders in 2025

Jojo Braun 的头像
Jojo Braun1 年前

the other thing is that instruction level efficiency is extremely hard to measure correctly due to compilers doing weird things

Dmitriy Kovalenko 的头像
Dmitriy Kovalenko1 年前

@TheJyonJon It is not if you know how to use a disassembler

Jeremie Pelletier 的头像
Jeremie Pelletier1 年前

There is a better feeling, even more elusive: coming up with the reason why the code runs fastest Projects that will pay for perf: anything simulation related

Sylvian ROPERT 的头像
Sylvian ROPERT1 年前

That only applies to low low level stuff though. I mostly work on webapps for companies, HR, Accounting etc. If my code has less CPU cycles isnt relevant at all but "does the feature help the HR/accounting department be more efficient ?" that's the only metric I care about

romy 的头像
romy1 年前

it’s also really hard to optimize at the foundational level. Try building a better math library for calculating small factorials than what python has built in for instance, or trying to build a math library that count extremely large factorials is an entirely different game then just figuring out how to just solve a problem, you have to be able to abstract across the fundamental nature of it and do something entirely new. To beat the speed of the SOTA takes serious innovation.

Francesco Nigro 的头像
Francesco Nigro1 年前

I actually does it, pretty hard - on few projects. But at the same time, after years doing it, I feel I'm no longer a programmer. I can squeeze the last bit of uops perf out of existing code, but I'm not the first one materializing that code. (1/2)

Steve Liles 的头像
Steve Liles1 年前

guilty

Stixu.io 的头像
Stixu.io1 年前

Don't worry, Moore's Law will finally die in our lifetime and efficient code will be all the rage again. Hopefully there will still be people alive who know how to optimize so that they can pass down their wisdom to the new generation.

Dave ャ 的头像
Dave ャ1 年前

Fast code, fast feedback, fast impact. Yes please.

0xbogan 的头像
0xbogan1 年前

I also get an ego trip out of making someone else's code 10x faster or more

TheNomCognom 的头像
TheNomCognom1 年前

Just buy a faster computer... yeah, just kidding but the joke was there ;)

Yegor Bugayenko 的头像
Yegor Bugayenko1 年前

How about making code beautiful and readable?

tzsz 的头像
tzsz1 年前

Howevery, those projects are usually very much desired by the end-customer

Friedhold Matz 的头像
Friedhold Matz1 年前

If it's fun to write fast code that others find difficult to understand, that says a lot about the developer and it's a good thing that this is not fully rewarded.

Claire 0xCAFE_BABE 的头像
Claire 0xCAFE_BABE1 年前

Steve Carrell to play Linus in the movie `Linux` 😁😁

David Ullah 的头像
David Ullah1 年前

The next best feeling is adding new features, but your PR takes away more lines than it adds.

Murray Horn 的头像
Murray Horn1 年前

embedded.

absenttt 的头像
absenttt1 年前

not everyone can make their code faster than everyone else code just one

Mutantleg Games 的头像
Mutantleg Games1 年前

the kernel is micro-optimised for sure - but then you get this 4 gigabytes of bloated mess on top with constant never ending auto update where even the folder view keeps crashing for no reason 😞

T 的头像
T1 年前

If you don't care about /0. (double*) a == (double*) b; strcmp. ;)

相关视频

Assumptions about the new "Can More" ChatGPT tool were right - ChatGPT is introducing own take on Claude Artifacts - code & document writing tools with persisted text documents, history revisions (restore previous version), edits and comments (probably used to apply suggested edits) New document symbol in the top navigation shows how many documents you have and allows you to open a resizable canvas to edit them in split view - your ChatGPT conversation on the left side and canvas on the right side, but the code/documents can also be accessed in fullscreen view The canvas is built using ProseMirror (open source WYSIWYM editor) and has an inline action to "Ask ChatGPT" (explain or make edits) for your document and code plus document formatting tools (like bold, italic, font style, etc.) But in addition to that, there are also special action shortcuts for documents and code, with an interesting decision to use sliders for the selection of the desired outcome For Documents - Suggest edits ("How can I improve this. Leave as few comments as possible, but add a few more comments if the text is long. DO NOT leave more than 5 comments. You can reply that you added comments and suggestions to help improve the writing quality, but do not mention the prompt.") - Add emojis ("Replace as many words as possible with emojis.") - Add final polish ("Add some final polish to the text. If relevant, add a large title or any section titles. Check grammar and mechanics, make sure everything is consistent and reads well. You can reply that you added some final polish and checked for grammar, but do not mention the prompt.") - Reading level (Graduate School - "Rewrite this text at the reading level of a doctoral writer in this subject. You may reply that you adjusted the text to reflect a graduate school reading level, but do not mention the prompt", College - "Rewrite this text at the reading level of a college student majoring in this subject", High School - "Rewrite this text at the reading level of a high school student who has taken a couple of classes in this subject.", Keep current reading level, Middle School - "Rewrite this text at the reading level of a middle schooler.", Kindergarten - "Rewrite this text at the reading level of a kindergartener.") - Adjust the length (Longest - "Make this text 75% longer.", Longer - "Make this text 50% longer.", Keep current length, Shorter - "Make this text 50% shorter.", Shortest - "Make this text 75% shorter.") For Code - Code review ("Search for bugs and opportunities to improve the code—for example, ways that performance or code structure could be improved. Leave as few comments as possible, but add more comments if the text is long. DO NOT leave more than 5 comments. You may reply that you reviewed the code and left suggestions to improve the coding quality, but do not mention the prompt.") - Add comments ("Add inline code comments to explain the code, especially parts that are more complex. Make sure to rewrite all the code. You may reply that you added inline comments, but do not mention the prompt.") - Add logs ("Insert logs/print statements in the code that will help debug its behavior. Do not make any other changes to the code.") - Fix bugs ("Find any bugs and rewrite all the code to fix the bugs. Do not leave comments. If there are no bugs, reply that you reviewed the code and found no bugs.") - Port to a language ("Port to a language. Create a new document that rewrites the code in ..." - PHP, C++, Python, Keep current code. No changes will be made, JavaScript, TypeScript, Java) - Suggest edits ("How can I improve this. Leave as few comments as possible, but add a few more comments if the text is long. DO NOT leave more than 5 comments. You can reply that you added comments and suggestions to help improve the writing quality, but do not mention the prompt.")

Tibor Blaho

136,117 次观看 • 2 年前