It's Really Just That Bad

  Рет қаралды 123,046

ThePrimeTime

ThePrimeTime

Күн бұрын

Пікірлер: 637
@klasus2344
@klasus2344 18 сағат бұрын
Zig only requires 75% of the text that Rust requires. Zig is faster to type and faster to say than Rust. Though way behind C, Rust comes out way ahead of Zig, alphabetically.
@NabekenProG87
@NabekenProG87 17 сағат бұрын
Those are the important metrics I use to choose which language I will use each week
@Reydriel
@Reydriel 17 сағат бұрын
lmaooo
@hanifarroisimukhlis5989
@hanifarroisimukhlis5989 17 сағат бұрын
That's funny af. We should bake every algoritm into the compiler as single-letter shortcut. 🤔
@pokefreak2112
@pokefreak2112 17 сағат бұрын
Based benchmark Really weird no-one uses the A language anymore when it's clearly the best
@npc-drew
@npc-drew 17 сағат бұрын
and unsafe by default
@alexeyku8926
@alexeyku8926 17 сағат бұрын
And then ChatGPT will learn on this data and will recommend you Fortran as fastest language ever
@NoUselessTech
@NoUselessTech 15 сағат бұрын
I mean, it sounds like it’s on par with C when all was said and done. So is it wrong? No. But I definitely don’t see a Fortran resurgence in the works.
@isaacdruin
@isaacdruin 15 сағат бұрын
Even worse, the Fortran code used for the benchmark may have been GPT's doing in the beginning (the string limit of 100 coming from some generic snippet of code GPT was trained on at some point). So now not only is this code producing the wrong results, GPT may train on it again and insert the 100 character limit next time some programmer asks GPT to write an algorithm for them. Recycling garbage to make more garbage.
@nectismanta8080
@nectismanta8080 13 сағат бұрын
@@isaacdruin Imagine GPT write valid Fortran code 😂😂😂
@NoX-512
@NoX-512 13 сағат бұрын
@@NoUselessTech Then you didn’t understand one of the points of this video. The result of these types of benchmarks can not be generalized. All it shows is that C and Fortran are, probably, comparable when comparing strings.
@infinitivez
@infinitivez 12 сағат бұрын
@@isaacdruin As someone who's been in fortran and pascal for years, I can say this is such a rookie mistake. So much so, that I had the very same assumption: it has to be AI jibberish. There's just no way someone would preallocate a buffer like this, without using a sensible limit (say 65535?) or why they didn't just allocate it using a pointer to begin with? I'm just utterly confused how anything but AI could be involved.
@carltongannett
@carltongannett 16 сағат бұрын
Worst news ever: the guy who made this benchmark impressed the csuite with the squiggly balls and promoted him to be your boss and supervise you rewriting your codebase from C to Fortran
@christopherdessources
@christopherdessources 15 сағат бұрын
And bans all strings longer than 100 characters
@Digitalgems9000
@Digitalgems9000 15 сағат бұрын
haha fr
@random6033
@random6033 13 сағат бұрын
pls tell me this is a joke
@regretamine.drifts
@regretamine.drifts 12 сағат бұрын
jesus christ man i didn't come to this video for a nightmare
@DFPercush
@DFPercush 12 сағат бұрын
accurate
@tylermfdurden
@tylermfdurden 13 сағат бұрын
Casey's energy of borderline livid but not to the level of screaming, just to the level of "I need to explain every detail of why I'm angry with you" is how I feel at work trying to explain things to people.
@sciencedaemon
@sciencedaemon 9 сағат бұрын
He sounds dumb exaggerating this stupid issue. It's like he has never been confronted with real problems.
@happyducky9872
@happyducky9872 5 сағат бұрын
​@@sciencedaemon he was pretty specific about why it was an issue, and that it was egregious enough to the point that a basic double check corrected the issues. Specific intended use cases + low required rigor. Its wholly irrelevant to whatever you seem to think its about.
@Muskar2
@Muskar2 Сағат бұрын
@@sciencedaemon This channel is entertainment in nature. Casey did pretty serious stuff and invented world class algorithms and patterns. IMGUI and "Killing the Walk Monster" (Walk Manifold) are examples. And I'd argue "Designing and Evaluating Reusable Components" is up there too.
@markolson8569
@markolson8569 16 сағат бұрын
The Fortran code had the right idea; you gotta wow them with your blazing speed and then tell them that comparison past the first 100 chars of the string is only available in the premium version
@FraserChapman
@FraserChapman 15 сағат бұрын
Fortran++
@johnsmith1953x
@johnsmith1953x 12 сағат бұрын
@@FraserChapman Fortran2023. Blows away ALL languages. Easy.
@suchislife801
@suchislife801 5 сағат бұрын
What kind of savage posts this benchmark online. Shenanigans....
@lanfeust06
@lanfeust06 13 сағат бұрын
"100 is one of the largest number known to man" Chat never disappoint
@bitti1975
@bitti1975 9 сағат бұрын
Anything behind 3 is just "large".
@GreedoShot
@GreedoShot 36 минут бұрын
The human eye can't even see beyond 24
@ChipKragt
@ChipKragt 16 сағат бұрын
Went to the repo, they've closed all the issues that point out how bad the benchmarks are. They've also fixed the Fortran issue, but haven't updated any of the sites that are showing the visuals. Smh. (this isn't just because I'm a Rubbish and hate to see it so low down)
@FlorianZier
@FlorianZier 41 минут бұрын
Yeah, looks like "it is what it is now" is more or less the default answer. Also, if the issues adress a specific problem, people shall open a PR with code changes. As far as I'm aware a pull request can still have a linked issue to provide discussion and more insight.
@matthartley6537
@matthartley6537 12 сағат бұрын
I think people are missing out on another feature of fortran on display here. Not only is it faster, but it also stores arbitrarily long strings in just 100 bytes! Thats amazing!
@jamesclark2663
@jamesclark2663 11 сағат бұрын
I have a compression algorithm that can store anything in zero bytes. You can't get anything back out of it but man if you need to store a lot of data it sure saves space!
@Digitalgems9000
@Digitalgems9000 11 сағат бұрын
@@jamesclark2663 haha
@somebody-anonymous
@somebody-anonymous 9 сағат бұрын
​@@jamesclark2663 /dev/null is web scale
@matthartley6537
@matthartley6537 6 сағат бұрын
@jamesclark2663 if you need to get data out, you can just use /dev/random, and you might get it back!
@Muskar2
@Muskar2 Сағат бұрын
@@jamesclark2663 Wow, so you're the author of the infamous free() compression algorithm. You should totally make a ball diagram and compare it to other compression algorithms like H.246, DCT and GC.Collect()
@doanamo
@doanamo 16 сағат бұрын
I cant get over how much this speed visualisation with bouncing balls sucks.
@samsak1239
@samsak1239 9 сағат бұрын
Love me some bouncing ball sucking
@ProfRoxas
@ProfRoxas 18 сағат бұрын
First rule of IT and CS: it depends
@g3rzin
@g3rzin 18 сағат бұрын
Actually that's the second rule. The first one is turn it off and on again!
@hanifarroisimukhlis5989
@hanifarroisimukhlis5989 17 сағат бұрын
Erm actually it's the first rule of science reporting 🤓
@Kane0123
@Kane0123 16 сағат бұрын
Actually the first rule is graphs don’t lie.
@niklas6047
@niklas6047 16 сағат бұрын
The first rule is it's the DNS' fault.
@PavitraGolchha
@PavitraGolchha 15 сағат бұрын
it depends ... on my machine
@advertslaxxor
@advertslaxxor 17 сағат бұрын
When I see a "graph" like that, I treat it like my unit tests. The tests are passing because the tests are wrong, not because the code is working :D
@Titere05
@Titere05 15 сағат бұрын
Hahah green unit tests mean whatever you're testing here is OK, but I wonder what it is you're really testing
@advertslaxxor
@advertslaxxor 13 сағат бұрын
@@Titere05 We're testing "return true", it is passing. We do good work!
@tordjarv3802
@tordjarv3802 13 сағат бұрын
Never trust a unit test you havn't seen fail
@hanifarroisimukhlis5989
@hanifarroisimukhlis5989 6 сағат бұрын
You should learn fuzzing lol. It'll find you some arcane test data that'll crash your program faster than you can say "oh shit".
@versacebroccoli7238
@versacebroccoli7238 8 сағат бұрын
This is definitely AI written Fortran code. A human who actually knew what that 100 meant would have known better. But AI just knows that usually 100 chars is long enough for most strings. I can't count how many times ChatGPT has given me char buffers of size 100.
@thekwoka4707
@thekwoka4707 51 минут бұрын
You'd except it to be more like ....255 or something...
@SergTTL
@SergTTL 10 сағат бұрын
Casey: I'm mad because I have to do this for the second time. Me: Really looking forward for the third episode now LOL.
@JustinDejong
@JustinDejong 16 сағат бұрын
Guy "Been around since the 70s. Primagen "1957 Guy "1960s sorry" Prime in his head "I want this guy to come back again so we're going to move on"
@LtdJorge
@LtdJorge 16 сағат бұрын
Exactly 😂
@JeremyAndersonBoise
@JeremyAndersonBoise 15 сағат бұрын
😂
@UnidimensionalPropheticCatgirl
@UnidimensionalPropheticCatgirl 15 сағат бұрын
I mean FORTRAN wasn’t really “production-ready” until 66 ( I am sure there were some early adopters having fun with earlier versions but that wasn’t the FORTRAN lot of people knew), but Casey probably just misspoke.
@wolfgangsanyer3544
@wolfgangsanyer3544 14 сағат бұрын
I convinced myself he said 1967 lol
@Houshalter
@Houshalter 6 сағат бұрын
It's an off by one error, happens all the time.
@brady1123
@brady1123 16 сағат бұрын
The Rust code similarly performs two heap allocations per distance calculation rather than using two pre-allocated arrays.
@LtdJorge
@LtdJorge 16 сағат бұрын
They should have put the text in variables, which don't even need allocations, since those are embedded in the binary in the text section.
@thesenamesaretaken
@thesenamesaretaken 10 сағат бұрын
​@@LtdJorgeyeah I'd have thought a little script to paste the text into the source code for each language would have made more sense because then there's neither command line parsing nor file io, but I'm not a software engineer, so maybe there's an obvious reason why that's stupid and I'm just dumb.
@electric26
@electric26 8 сағат бұрын
​@@thesenamesaretakenwith Rust you can `include_str!("input.txt")`, which does exactly what you want but without scripts
@hanifarroisimukhlis5989
@hanifarroisimukhlis5989 6 сағат бұрын
@@electric26 But then LLVM _might_ over-optimize that, so the result is invalid.
@electric26
@electric26 5 сағат бұрын
@@hanifarroisimukhlis5989 let input = include_str!("input.txt"); let input = std::hint::black_box(input);
@Exilum
@Exilum 13 сағат бұрын
I really started this video thinking "it's a bad benchmark again, who cares", then I got to the part where it became clear the results themselves were wrong and damn now that's real shit
@hanifarroisimukhlis5989
@hanifarroisimukhlis5989 18 сағат бұрын
21:25 Visual Studio: _Bonjour_ EDIT: And that is why differential fuzzing is important. You never know your "optimized" version is always correct compared to naive one.
@hinzster
@hinzster 8 сағат бұрын
I believe Visual Studio grabbing all those file associations and making you wait for it to start, just to close it down because in 99% of the cases you didn't want it to, is the single reason Windows is *horrible* for development. Use anything, even a potato will be better, but don't use Windows.
@hanifarroisimukhlis5989
@hanifarroisimukhlis5989 6 сағат бұрын
@@hinzster Remember, when you type `py ...` on command line it'll automatically try to install *Microsoft Store version* of Python. Not even PATH can override it, you have to specifically remove it in some obscure settings.
@Iantrypsk
@Iantrypsk 17 сағат бұрын
I had the same reaction as prime of "why the fuck Fortran optimized for this shit what is the trick". Casey was like hell no thats bullshit and investigated the bullshit, respect
@vasiliigulevich9202
@vasiliigulevich9202 15 сағат бұрын
@Iantrypsk latest version has Pascal in the first place. It leads with significant interval. We can expect same bug there.
@huvarda
@huvarda 17 сағат бұрын
The plot twist of the fortran code trimming the arguments to 100 characters was hilarious 33:50
@noomade
@noomade 17 сағат бұрын
why spoil it then...
@huvarda
@huvarda 17 сағат бұрын
@@noomade because a lot of people probably dont have time to sit down and watch a 50 minute video? do you think someones experience of watching this video is going to be ruined because i provided a point to jump to to see an interesting part? idk man. this isnt the sixth sense its a programming youtube video
@noomade
@noomade 17 сағат бұрын
@@huvarda You are a hero! LOL
@DFPercush
@DFPercush 12 сағат бұрын
I facepalmed so hard. And yes it's long, but the suspense was very entertaining.
@dumbpenguin900
@dumbpenguin900 15 сағат бұрын
When the CS/Devs set up pseudo scientific experiments and then publishes without checking their work..its pretty wild. Stop making business majors look smart. Casey is goated.
@tordjarv3802
@tordjarv3802 13 сағат бұрын
If someone say "Programming language X is faster than language Y" they are probably not very good at either X or Y.
@ashutoshsamantaray6596
@ashutoshsamantaray6596 Минут бұрын
I feel like that still stands up to mark if you compare C to Python.
@robertvandrovec
@robertvandrovec 16 сағат бұрын
I looked at the Zig implementation, it uses Arena around Page Allocator! And that its not the only mistake there . . .
@Caesim9
@Caesim9 14 сағат бұрын
Like, what???
@NoX-512
@NoX-512 13 сағат бұрын
Probably written by chad gipidy.
@robertvandrovec
@robertvandrovec 10 сағат бұрын
@@Caesim9 Few unnecessary comparisons, overall it HEAP allocates, even args. If you want to keep the HEAP allocations dont use page_allocator for this. In Zig its so easy to use STACK, especially since you have known input size. Also the algorithm could be improved. Overall the LLVM Languages should be around the same speed. This comparison is not correct since they are not doing the same thing, WHEN THEY CAN BE 😆.
@hanifarroisimukhlis5989
@hanifarroisimukhlis5989 6 сағат бұрын
But how would you allocate an unknown length of string? In stack?
@NoX-512
@NoX-512 6 сағат бұрын
@@hanifarroisimukhlis5989 As far as I remember, the C implementation use argv[] directly, thus avoids extra mem alloc.
@pavel45568
@pavel45568 16 сағат бұрын
After about 10 minutes in I just realised that they are talking to each other. Until that moment I thought he is commenting a recorded stream)
@XxZeldaxXXxLinkxX
@XxZeldaxXXxLinkxX 14 сағат бұрын
Same, I thought he was just having some god tier timing with his comments and extremely coincidentally relevant remarks from casey
@antoniogarest7516
@antoniogarest7516 13 сағат бұрын
Lol
@_vicary
@_vicary 17 сағат бұрын
laziness and incompetence is the most infuriating thing in the industry
@nakatash1977
@nakatash1977 10 сағат бұрын
Don't forget arrogance
@non_complete
@non_complete 8 сағат бұрын
@@nakatash1977 the unholy trinity. Lazy arrogant incompent.
@AloisMahdal
@AloisMahdal 10 сағат бұрын
To be fair, there's one thing they dd get right: the colors of the balls really match the colors of the logos.
@AnzenKodo
@AnzenKodo 18 сағат бұрын
you should have made Community Notes on original post
@perguto
@perguto 18 сағат бұрын
The name is the CASEYGEN! 🔥🔥🔥
@ninomojo
@ninomojo 17 сағат бұрын
The Primatori!
@roccociccone597
@roccociccone597 17 сағат бұрын
I bet that there are countless NPCs on LinkedIN sharing that initial benchmark... xD... I would pay Casey to teach me low level concepts about programming... I love these in-depth dives into programming man.
@CompiledGabriel
@CompiledGabriel 16 сағат бұрын
I'm pretty sure he actually has an optimization course lol
@IgorStojkovic
@IgorStojkovic 15 сағат бұрын
His course is named Computer, Enhance. Just Google it.
@SimonBuchanNz
@SimonBuchanNz 6 сағат бұрын
"NPCs" ugh
@AnonUser-b6y
@AnonUser-b6y 15 сағат бұрын
Part of the Fortran speed isn’t just truncation, by having a static length (100) for each string the allocation is faster and potentially it’s even one giant string blob in memory for better preloading. The issue is this is not a like for like comparison because the other languages use dynamic string lengths.
@dealloc
@dealloc 13 сағат бұрын
It is even shown that you won't even need heap allocations as per the C version. So why all the other languages use any form of allocator is beyond me. But this is exactly what Casey speaks about is the problem.
@johnsmith1953x
@johnsmith1953x 12 сағат бұрын
Its also basic information theory. Restricted chars to 100 allows for massive optimization.
@guidogiuntoli4184
@guidogiuntoli4184 14 сағат бұрын
Lesson: don't trust anybody, as Torvals said, “Talk is cheap. Show me the code.”
@scheimong
@scheimong 18 сағат бұрын
16:38 to skip all the yapping 27:38 to skip more yapping 33:45 to skip to where the Fortran impl fucked up 38:28 to skip to the proper results
@zbyniew
@zbyniew 17 сағат бұрын
Zoom zoom zoomer
@HairyPixels
@HairyPixels 17 сағат бұрын
thanks bro
@noahtah1511
@noahtah1511 17 сағат бұрын
idk im here for the yapping
@scheimong
@scheimong 17 сағат бұрын
If you want to watch the whole thing, go for it. I'm not going to tell you what to do. But if you got 5 minutes, here's everything you need.
@mirata9
@mirata9 17 сағат бұрын
Yeah jfc I’m at 5 min. where is the content
@chepossofare
@chepossofare 15 сағат бұрын
The fun thing is that Muratori in Italian means "Builders".
@matias-eduardo
@matias-eduardo 14 сағат бұрын
That’s actually awesome haha
@birthdayzrock1426
@birthdayzrock1426 14 сағат бұрын
bricklayers
@lasershark1237
@lasershark1237 18 сағат бұрын
Oh Jesus Christ, from 20 mins onwards... the revelations... oh God.
@Zzzooooppp
@Zzzooooppp 8 сағат бұрын
8:30 it’s not really n^4 it’s more like n^2*m^2 where m is average string length and n is number of strings, no?
@miketerry4309
@miketerry4309 15 сағат бұрын
In CS 1250 years and years ago, I wrote a Pascal program to compare the speed of six different sorting algorithms. The first thing I did was to make sure that the timing was just surrounding the actual sort algorithm, whichever one of the six it was the second thing I did was to make sure that I wrote the output from the sort to a disc file so I could then do a gift from the original to Other the output from one algorithm to the output of another algorithm, making sure that each algorithm was functioning correctly. If the author of this blog post had done that one simple little thing they would’ve realized the four train program was broken prime and the other gentlemen are 100% correct do not take any benchmarks at face value not unless they’re an industry standard benchmark.
@thetomato2
@thetomato2 15 сағат бұрын
damn this guy was programming in the dark ages
@ChaotikmindSrc
@ChaotikmindSrc 14 сағат бұрын
@@thetomato2 I did pascal too XD Lot of fun at home on my crappy 286
@maighstir3003
@maighstir3003 8 сағат бұрын
@@ChaotikmindSrc Reading quickly, it could be interpreted as "1250 years ago" rather than "many years ago, in Computer Science 1250".
@ChaotikmindSrc
@ChaotikmindSrc 52 минут бұрын
@@maighstir3003 Well, programmign on a 286 with msdos was maybe not the dark ages, close enough !!!
@oblivion_2852
@oblivion_2852 17 сағат бұрын
Just for fun I want to do a "Will it SIMD" benchmark suite where I try to simd an algorithm automatically and manually in each language. I'd like to understand which languages have good data oriented design principles and performance potentials. Since most languages use llvm now I just want to know what frontends are easy/elegant to write simd. I've seen rust simd and it looks horrifying
@oblivion_2852
@oblivion_2852 17 сағат бұрын
Might be an interesting challenge to make a flat hashmap. Which includes some pretty complex math, memory management, paging, indexing, searching, insertion etc. And after its finished you'd have a bunch of potentially faster implementations in each language
@ashnealpowell7747
@ashnealpowell7747 16 сағат бұрын
Whoa! This is exactly the sort of thing in exploring in Rust right now, are you able to provide examples of ugly Rust SIMD stuff?
@stefanalecu9532
@stefanalecu9532 16 сағат бұрын
What if you don't have intrinsics available? Do you lower down to assembly?
@oblivion_2852
@oblivion_2852 10 сағат бұрын
@@ashnealpowell7747 prime read an hour article on rust simd for a static S-tree for dna lookup. It had simd code examples in rust... They didn't look readable
@oblivion_2852
@oblivion_2852 10 сағат бұрын
@@stefanalecu9532 I'd first be looking to see if the compiler can even produce simd output. If you didn't know even Java now has simd performance if you hot path a code block enough and the runtime can optimise it on the fly. I noticed when doing >100k operations java would simd the code
@Tony-dp1rl
@Tony-dp1rl 17 сағат бұрын
Just as a side note, several of those C methods using pointers were missing "restrict" keyword use, which in many C compilers would have made them much faster in my experience.
@senyai
@senyai 13 сағат бұрын
Calling `strlen` n times instead of (2 * n^2) times would also help.
@Henrik_Holst
@Henrik_Holst 11 сағат бұрын
not entirely sure when the compiler can see the source since it then can defer automatically that the pointers are restricted. restrict is mostly there when you call functions in libraries where the compiler cannot analyze the code.
@tapwater424
@tapwater424 57 минут бұрын
@@Henrik_Holst Maybe GCC with O3 is smart enough to optimize it, but generally functions have to be static for certain optimizations to happen automatically since it guarantees it's not a library function
@handle-h5m
@handle-h5m 22 минут бұрын
@@tapwater424 There's only 1 source file and it's the main unit, functions within are as good as static, and the pointers are almost certainly local variables which is just another reason it wouldn't matter.
@SeanDaley-m3c
@SeanDaley-m3c 17 сағат бұрын
Honestly, I think the worst thing here is that it looks like they fixed the code but didn’t readjust the “graph” that they show? It still seems the same as the video but the length stuff has been adjusted.
@iangirvan8141
@iangirvan8141 15 сағат бұрын
I'm sure they got some serious increase in traffic on their "graph" page that they are enjoying.
@janwalewski1997
@janwalewski1997 16 сағат бұрын
Prime I really love your videos with Casey. I always have such a good time watching them. Sadly I don't have the opportunity to watch your stream so thanks for reposting these gems on YT.
@obkf-too
@obkf-too 16 сағат бұрын
I am loving this, keep up the energy Casey.
@GackFinder
@GackFinder 13 сағат бұрын
Dude made the algo in Java and then asked ChatGPT to generate slop for all other languages, and now ChatGPT will be fed it's own slop.
@theTweak0284
@theTweak0284 13 сағат бұрын
I write fortran (essentially F77 with some nice things from F90) due to some libraries that I work with, and I have immense respect for anyone who was forced to write in a language that did not let function or variable names be longer than 6 characters.
@NoX-512
@NoX-512 12 сағат бұрын
BASIC on C64 only had 2 character variable names. It basically sucked.
@monsterhunter445
@monsterhunter445 12 сағат бұрын
​@NoX-512 could be worse c64 had limited memory . At least with two characters it's still pretty good 27*×27
@NoX-512
@NoX-512 12 сағат бұрын
@@monsterhunter445 26x36. The second char could be a decimal digit. The problem was remembering what variables were used for when you can't give them sensible names and all variables are global. It wasn't much more difficult to write assembly on C64 compared to BASIC, and it was about 1000 times faster.
@johnsmith1953x
@johnsmith1953x 12 сағат бұрын
Nearly all the mechanics/electronics/chemistry/physics code that runs on the worlds Top 500 supercomputers is written in Fortran77/90/2003/2008/2023 with MPI. There are many ALOT of reasons for this.: speed, compactness (think of MATLAB/Openfoam combined), legacy, hardware support, etc.
@NoX-512
@NoX-512 12 сағат бұрын
@@johnsmith1953x It hasn't got anything to do with speed. Fortran is not faster than C, C++, Zig, Odin, Rust, etc.
@code-dredd
@code-dredd 15 сағат бұрын
No, I want more grumpy Casey Muratori code reviewer. Angry code review is one of my spirit animals.
@DJ-3maj
@DJ-3maj 11 сағат бұрын
21:19 This little maneuver is gonna cost us 51 years
@Digitalgems9000
@Digitalgems9000 11 сағат бұрын
LOOL
@Digitalgems9000
@Digitalgems9000 11 сағат бұрын
bro i gotta make a meme video out of that
@sjfsr
@sjfsr 13 сағат бұрын
When I first saw what you were doing, the concerns and questions you came up with, is exactly what I was thinking. I questioned: what is the code? is it optimized? and this will just mislead too many.
@giorgio5127
@giorgio5127 10 сағат бұрын
I went to read the PHP version and it's using a custom implementation while PHP has its builtin function for levenshtein. Nobody would ever implement their version, the builtin version would be probably close to C if you test only that function call. So, this is poorly done on so many levels...
@CharlesVanNoland
@CharlesVanNoland 16 сағат бұрын
The fact that the benchmark is using the bouncing-dot visualization is all the evidence you need that the benchmark is made by a goober that doesn't know what they're doing - a regular #SillyclownValley Bro
@eliasepg
@eliasepg 16 сағат бұрын
really loved this video! Really informative, well explained, it's just cool.
@ike__
@ike__ 16 сағат бұрын
Looking into Fortran like that is like being a historian! I can image people will be doing the same thing in a few decades with the code we write today
@microcolonel
@microcolonel 5 сағат бұрын
There is no "command line parsing" involved. This is Unix exec, the command line parameters in main are separated by the SHELL and are made available to the process as an array of pointers to C strings.
@earx23
@earx23 13 сағат бұрын
Fortran has built in support for vectors. Back in the day the Intel compiler gave a bit of an edge too. All in all, for number crunching, Fortran + Intel compiler was where it was at. Nowadays.. I don't really know. Using SIMD intrinsics can make any language fast. And intrinsics in Rust are better than in C, because of the stricter typing. There are lies, damn lies, and there are benchmarks.
@ped7g
@ped7g 9 сағат бұрын
There I was, spotting at 6:38 two `strlen` calls and thinking maybe Fortran is using Pascal-like string with length precomputed, waiting for another 20+minutes for the story to unfold in direction I did hope it will not go. So it was just novice level incompetence, nothing at least slightly more tricky. Dear benchmark author, thank you, my trust in humanity went again lower. Son, I am disappoint.
@1337cookie
@1337cookie 17 сағат бұрын
@26:04 It'd be a shame if the output of the program was limited by the speed of the terminal...
@LtdJorge
@LtdJorge 16 сағат бұрын
There's no slow down, because they are passing the data as arguments to the binary, so at startup, all the data is there already. But of course it is completely stupid.
@_FFFFFF_
@_FFFFFF_ 14 сағат бұрын
There is still a slow down. Please see where the string is printed to terminal in the Fortran version.
@Henrik_Holst
@Henrik_Holst 10 сағат бұрын
@@_FFFFFF_ he removed that at 36:24 so that debug output was never part of the timing
@1337cookie
@1337cookie 4 сағат бұрын
@@LtdJorge Casey made a reference terminal because the windows terminal was slow, in that project somewhere he references how the output speed of the terminal can limit the speed of a program. twas but a joke.
@consciousmi4842
@consciousmi4842 17 сағат бұрын
I really enjoyed the frustration this guy showed and enjoyed watching the whole episode.
@ahmetyazc7969
@ahmetyazc7969 13 сағат бұрын
"maybe a 100 means like... give it a 100%" LMAO
@ArturdeSousaRocha
@ArturdeSousaRocha 16 сағат бұрын
This should be a must-watch at CS courses.
@araa5184
@araa5184 18 сағат бұрын
Lmao that moment of regret when you accidently open MSVS and it loads 😂
@TheEVEInspiration
@TheEVEInspiration 8 сағат бұрын
"This benchmark written by experts for experts" has me smiling.
@eightsprites
@eightsprites 17 сағат бұрын
Check: Argument lengths Could it be truncating the input data? I don’t remember the max size, but there is an max size of arguments. 256, 4096… it’s something.. it’s not 1Tb atleast.
@UnidimensionalPropheticCatgirl
@UnidimensionalPropheticCatgirl 15 сағат бұрын
getconf ARG_MAX will output the max arg size in bytes… It tends to be in the range of tens of kilobytes on most UNIX systems, sometimes even hundreds. I think it’s 8kb on windows but don’t quote me on that.
@smc4229
@smc4229 7 сағат бұрын
This just goes to show about how micro benchmarks can hurt as much as they can help..this was a fantastic discussion
@Veptis
@Veptis 16 сағат бұрын
Looking at the code, especially with these comments... Might it be language model generated/translated? I wonder if this 100 limit was made up by GPT in the end.
@LtdJorge
@LtdJorge 16 сағат бұрын
Likely
@stefanalecu9532
@stefanalecu9532 15 сағат бұрын
I've generated Fortran code with GPT before and it always, always likes to choose 100 as an upper bound, even when (len=:) (aka unbounded) strings and arrays were an option.
@KevinInPhoenix
@KevinInPhoenix 16 сағат бұрын
There are lies, damn lies, and benchmarks.
@earx23
@earx23 13 сағат бұрын
you beat me to it.
@jsalsman
@jsalsman 15 сағат бұрын
As someone who is currently trying to parallelize Needleman-Wunsch matching on CUDA, I would like to say, AAARGHHH!
@JG-nm9zk
@JG-nm9zk 17 сағат бұрын
Looked at the Lua code. disgraceful. Edit: On my machine their LuaJIT runs 55.8ms and with 2 small changes I got it down to 22.9ms. LuaJIT is Faster than Zig!
@JG-nm9zk
@JG-nm9zk 15 сағат бұрын
Their "optimization" made it slower They had -- Pre-compute string indices for faster access local s1_bytes = {s1:byte(1, m)} local s2_bytes = {s2:byte(1, n)} ... s1_bytes[i] == s2_bytes[j] But if you just do s1:byte(i) == s2:byte(j) boom more than 2x faster
@skaruts
@skaruts 11 сағат бұрын
lol it's even faster if you let it run for longer. LuaJIT takes a little bit to gather enough information about your code to be able to accelerate it properly. So the benchmarks are always slower at the start. That's why I always run my benchmarks in waves, so I can ignore the first wave or two. I can't imagine how crappy the zig code must be...
@mousedits
@mousedits 11 сағат бұрын
Crazy, Fortran was my first language in 2017 at university for mechanical engineering, some old ass professor that is addicted to rocket science was still teaching us that. Honestly, such a impossible language to learn as your first one, was something that kept me away from programming in general for years :(
@1337cookie
@1337cookie 17 сағат бұрын
I love when Casey is upset.
@JeremyAndersonBoise
@JeremyAndersonBoise 15 сағат бұрын
Angry Muratori is the best. 🎉
@andrewdunbar828
@andrewdunbar828 9 сағат бұрын
A collaborative platform for such benchmarks which includes both testing and contributions to both implementations and tests would be cool. I'd be surprised is they don't already exist.
@danser_theplayer01
@danser_theplayer01 16 сағат бұрын
I understand none of these languages, except maybe the 2 or 3 of windows cmd commands he wrote. But I can't stop watching. I NEED to find this 2ms difference, where ist it?! This is too exciting.
@adrtivv
@adrtivv 18 сағат бұрын
Always knew Rust is faster than Zig. /s
@Karol-g9d
@Karol-g9d 17 сағат бұрын
it lack public peer review . I suspect this is industry wide .
@majus1334
@majus1334 14 сағат бұрын
Public peer review wasn't welcome, apparently. Not surprising, lol.
@james-s-smith
@james-s-smith 12 сағат бұрын
29:23 "No one saw that." -Casey Muratori, 2025
@0xero7
@0xero7 16 сағат бұрын
KZbin is STRUGGLING with the compression 😂
@borkware
@borkware 8 сағат бұрын
For whatever reason it decided to drop me to 480p, which is chonky pixels. Switching to a higher res makes it easier to read the text.
@hydrobolix3365
@hydrobolix3365 14 сағат бұрын
JS over C#, PHP under Scala/Node, Someone doesn't deserve strings
@el_quba
@el_quba 16 сағат бұрын
Well, out of curiosity I looked at the Rust version, because couldn't believe it's doing so badly and I found the rows being allocated on heap so of course it will be slower than C.
@thedeemon
@thedeemon 15 сағат бұрын
Their length is only known at run time, so stack allocation becomes not as simple and straightforward as the naive approach here.
@vytah
@vytah 10 сағат бұрын
@@thedeemon the levenshtein function could take two more &mut Vec parameters for those two buffers, and grow them if needed. Or you could even preallocate them in main based on the max size of the arguments.
@emd1999
@emd1999 16 сағат бұрын
Fortran is not really esoteric and is used in pretty important things, especially for high performance computing applications and large scale scientific simulations. There are plenty of people that can look at and interpret Fortran code....
@stefanalecu9532
@stefanalecu9532 15 сағат бұрын
It's esoteric for the React kiddos and the Rust diehards maybe...
@andreasmortensen6809
@andreasmortensen6809 36 минут бұрын
Ok so at around 3:11 to 3:30 Casey starts to talk about harm and damage being done by the initial graph and this is just really irresponsible of him. The fact that someone made a graph thats wrong about language performances (maybe not even AS wrong as they like but whatevs) is not some great moral injustice, it is not tearing away the very fabric of society and the Primeagen should actually push back MORE on this point. The kind of hyperbole that Casey is doing is exactly where we start to get the justification for harrasment campaigns and its honestly just not ok.
@Omnifarious0
@Omnifarious0 5 сағат бұрын
If the test data was stored in static data, I could make the C++ version look totally legit to most people, but the code gen would have it just printing out the correct answer.
@spicybaguette7706
@spicybaguette7706 14 сағат бұрын
I just love Casey roasting poor benchmarks
@KangoV
@KangoV 15 сағат бұрын
This was a cool watch. Thanks. On the JVM we use Java Microbenchmark Harness (JMH) which handles building, running and analysing nano/micro/milli/macro benchmarks. Do other languages have something similar?
@UnidimensionalPropheticCatgirl
@UnidimensionalPropheticCatgirl 15 сағат бұрын
You would use HPCs from perf (or some library that helps with them) in C++, don’t know how well this is supported in other languages.
@rtvdenys
@rtvdenys Сағат бұрын
It's the problem which is perhaps two or three decades old. I remember looking at the Computer Language Shootout more than fifteen years ago and oh Lord it was an abomination. It was easy for a terribly buggy, fine-tuned for the task set code to win, while robust solutions were penalised. The best course of action is to ignore silly benchmarks and just use your brain instead. N.I. rocks.
@jamesm5192
@jamesm5192 18 сағат бұрын
It would be nice to have a list of "one best language per use case" put together by people who apparently have thousands of hours to test such things. 1) Zig 2) JS (TS, but most of us don't wanna re-learn) 3) Bash 4) ??? 5) Complete pkg plz
@night_h4nter
@night_h4nter 14 сағат бұрын
i don't think it's possible to have a cnclusion about it. a lot still comes down to preference
@jamesm5192
@jamesm5192 14 сағат бұрын
@@night_h4nter I'm not saying everyone will agree, but having thousands of videos of details for the viewer to try to distill into something meanful and useful is just adding noise to our already extremely noisy environment of signal hunting.
@night_h4nter
@night_h4nter 14 сағат бұрын
@@jamesm5192 well, then it's gonna be even more noise, just without details this time, isn't it?
@berbold
@berbold 18 сағат бұрын
Visual Studio desperate to be part of the conversation 😅
@MacSvensson
@MacSvensson 12 сағат бұрын
🤣
@Kim-e4g4w
@Kim-e4g4w 17 сағат бұрын
I hope Casey one day writes a book on C and his take on tips and tricks for making games in C.
@matias-eduardo
@matias-eduardo 14 сағат бұрын
I think he could write a book on Software Architecture and it’d be an instant classic. He’s quite good at it.
@donwinston
@donwinston 11 сағат бұрын
I've fond memories of writing numerical analysis algorithms and simulations in FORTRAN and SLAM with no user interface to bother with. Nowadays I have to deal with CSS and Javascript distractions from my Java code.
@lazyman2451
@lazyman2451 11 сағат бұрын
Why Ruby on Rails still in use if it’s soo slow.
@SanderTeunissen
@SanderTeunissen 12 минут бұрын
C# being so slow is interesting to me. I implemented a thesaurus once in C# with a calculation for Levenshtein distance and I definitely calculated Levenshtein for more than 6 words per request and was consistently done in less than 300ms, so I am inclined to say it's just fake data.
@flyingsteaks
@flyingsteaks 15 сағат бұрын
For me, the most hilarious part actually was finding out that tweet and reading the replies and quotes, some supposedly experts trying to defend this bullcrap is gold lmao
@apatterndarkly
@apatterndarkly Сағат бұрын
Someone needs to sue and establish precedent that this is defamation and that this kinda thing cannot be published without due diligence.
@kenny-kvibe
@kenny-kvibe 15 сағат бұрын
amazing work, loved the video and the detailed explanations!
@Tekner436
@Tekner436 2 сағат бұрын
when he opened visual studio on accident i was expecting a "we'll be back after a 5 min break" lmao
@carltongannett
@carltongannett 16 сағат бұрын
For most use cases just writing good code that does it’s work in the most efficient way to reduce time and/or memory complexity is way more impactful than what language you use.
@1337cookie
@1337cookie 4 сағат бұрын
Plot twist; The project is just data poisoning for LLMs.
@TheRadischen
@TheRadischen 17 сағат бұрын
the odin creator ginger Bill, also complaines about these benchmarks all the time
@g0t4
@g0t4 13 сағат бұрын
fixed length strings in fortran?
@ammonmiranda9296
@ammonmiranda9296 6 сағат бұрын
at 41:35 I really understood, from deep within my heart, how much microseconds matter. Haha. Much respect for this deep dive fellas! Knowing how 43:08 this is is great. 🙏
@AnataTanuki
@AnataTanuki 5 сағат бұрын
The takeaway I have from this is that public benchmarks are simply benchmarks for the tester's proficiency in the program.
@avwie132
@avwie132 3 сағат бұрын
The problem is that people derive conclusions from 1 tweet. If your takeaway from that benchmark is that Fortran is twice as fast as zig then you have no business being in the software engineering world. The fact that everyone everywhere starts retweeting and reposting these shit benchmarks shows exactly what is wrong with the software dev workd
@andrewdunbar828
@andrewdunbar828 18 сағат бұрын
Zig, Rust, Go, Odin, and Swift will all be doing array bounds checking by default for starters.
@AnonUser-b6y
@AnonUser-b6y 18 сағат бұрын
Fortran does array bounds as well. It’s just showing that FORTRAN is good at optimizing math algorithms written by people who don’t understand low level optimization. This is not surprising because FORTRAN was created to help non-software engineers write efficient algorithms for very limited hardware.
@permutationlock
@permutationlock 17 сағат бұрын
I would assume that you are compiling Zig in ReleaseFast for a benchmark which does not have runtime slice bounds checking.
@CjqNslXUcM
@CjqNslXUcM 17 сағат бұрын
Properly written Rust will omit them here, since you're just going through from 0 to len - 1, which is trivially statically analyzable as being always within the bounds.
@anonymousalexander6005
@anonymousalexander6005 17 сағат бұрын
@@CjqNslXUcMKnowing the audience, they’ll probably try to argue that -O0 and -ReleaseFast are fair equivalents (because Rust is just that slow, obviously), as if they don’t produce the exact same assembly when you actually use equivalent optimization flags.
@andrewdunbar828
@andrewdunbar828 17 сағат бұрын
@@permutationlock Yep I would assume the same for a good benchmark, but since they're roasting this benchmark I'm assuming not.
@brooklynground7090
@brooklynground7090 18 сағат бұрын
Whats up with this benchmark thing? Did I miss something?
@Chimperly
@Chimperly 17 сағат бұрын
there a benchmarks to see how fast a language is, basically they are just set algorithms that each programming language needs to run and we can see which is the fastest. Generally these translate to how fast your application will run. The issue here is that the person who made the benchmark made it so that the fortran algorithim was flawed and did not reflect the necessary work required for completion in comparison to the other languages. Namely the strings they are comparing were shorter by more than half of that of the c algorithim. When the algorithims are equal, c becomes faster. Basically we are calling the benchmarking implementation into question through this excercise. does that make sense?
@volbla
@volbla 16 сағат бұрын
Someone trying to go viral on twitter without knowing what they're doing.
@Veptis
@Veptis 17 сағат бұрын
So... The benchmark isnt about a loop of calculating all edit distances. It's about dinfind the smallest one. Which is a different problem. Like you can do some optimizations. For example: exit early and sort the list of candidicates by lengthy beforehand. Maybe even use a hash to skip identical strings directly.
@thedeemon
@thedeemon 15 сағат бұрын
Sure, but if all solutions don't do it, such comparison becomes even more meaningless
Creator of Ghostty talks Zig over Go
1:20:26
ThePrimeTime
Рет қаралды 69 М.
Picking A Language In 2025
37:59
ThePrimeTime
Рет қаралды 95 М.
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
I Believe The Universe Might Be Able To Think.
10:02
Sabine Hossenfelder
Рет қаралды 236 М.
I Quit Amazon After 2 Months
29:39
ThePrimeTime
Рет қаралды 390 М.
What is OpenTelemetry?
12:55
Highlight
Рет қаралды 19 М.
You've Grabbed My Attention
12:02
Linus Tech Tips
Рет қаралды 461 М.
Doctor Reacts To Rarest Diseases
15:53
Doctor Mike
Рет қаралды 750 М.
AMD's Crazy Apple M4 Killer
11:23
Hardware Canucks
Рет қаралды 153 М.
The Future of HTMX
53:09
Theo - t3․gg
Рет қаралды 42 М.
Apollo DSKY - part 1: we have a real (and broken) DSKY!
22:04
CuriousMarc
Рет қаралды 2,6 М.
Interview with Esoteric Language Academic 2024
8:49
Programmers are also human
Рет қаралды 217 М.
Every programming language explained in 15 minutes | Prime Reacts
43:42
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН