Загрузка видео...

Не удалось загрузить видео

На главную

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 лет назад