Тёмный
No video :(

E03: C# vs Java: Which is Faster? Computer Language Drag Racing Series 

Dave's Garage
Подписаться 792 тыс.
Просмотров 160 тыс.
50% 1

Which language produces the fast apps? How do C# and Java Compare? How are bytecodes and IL different?
Dave takes you on a tour of C# and Java and then drag races them by running them through their paces with a prime number generation benchmark in Episode 03 of the epic Computer Language Drag Racing Series episode 03. This series tests more than 60 languages by having the same goal in each language - solve all the primes under one million as many times per second as possible.
Languages tested in the series include ARM ASM, X86 ASM, Ada, BASIC, Bash, C, C++, C#, D, Dart, Delphi, F#, Fortran, Go, Haskel, Java, Julia, Lisp, Lua, Node, Nim, OCaml, Octave, PHP, Pascal, Perl, Powershell, Python, R, Ruby, Rust, Scala, SQL, Swift, TypeScript, V, Zig, and more are being added!
Each round, languages are tested in groups, such as C vs C++ vs Rust, Python vs BASIC, Ada vs Pascal vs Delphi, and so on.
Github Code: github.com/PlummersSoftwareLL...
The Shirt (static blue): amzn.to/2VnFuzF
Episode List:
E00: • E00: Software Drag Rac...
E01: • E01: What is the FASTE...

Опубликовано:

 

22 июл 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 1 тыс.   
@kirkeasterson3019
@kirkeasterson3019 3 года назад
Name suggestion: Fizzbuzz Aldrin
@PhilipStorry
@PhilipStorry 3 года назад
The Stig was named after a character from a children's book - "Stig of the Dump". So the only choice for our new friend's name must surely be "Stack", or to give him his full name "Stack of the Dump". 😉
@igorthelight
@igorthelight 3 года назад
+1 for Stack
@excitedbox5705
@excitedbox5705 3 года назад
Stack Dump. I like it.
@DavesGarage
@DavesGarage 3 года назад
I like it... but rather than just "Stack", maybe he should be "The Stack" to stay orthogonal with "The Stig"? Does it matter?
@PhilipStorry
@PhilipStorry 3 года назад
@@DavesGarage That's a very fair point, The Stack is better. Feel free to use that if you prefer it! :-)
@Damaniel3
@Damaniel3 3 года назад
Perfect.
@Midnotion
@Midnotion 3 года назад
Java runtimes have been doing JIT for ages now, and are even smart enough to only spend time optimizing frequently-executed code, eliminating the overhead of compiling the full thing.
@neil2444
@neil2444 3 года назад
With some tweaking, I've seen Java be competitive with C++. Of course you have to disable garbage collection..
@sysosmaster
@sysosmaster 3 года назад
@@neil2444 you mean “take controle of the Garbage Collection”, the GC is not in your way of you tell it when to work…. Instead of letting it run at its own schedule.
@framegrace1
@framegrace1 3 года назад
Also, there are other languages that compile in java byte code, even functional ones like scala. And at the beginning, java byte code had to had a hardware CPU implementation called picojava. I've seen the Fujitsu implementation running and was very cool. Few people remembers that java origins were to be a language for microcontrolers, like micropython is today. The bytecode idea was to be able run on java native microcontrolers, or be compiled to any other microcontroler easily.
@neil2444
@neil2444 3 года назад
@@sysosmaster The algorithm itself for the GC is way more taxing than simply deallocating the allocated memory like you would in C++. I don't recall what they did exactly, but I think it involved launching garbage collection after memory was freed, and even then, only at the end. When you think about it, deallocation of memory is O(1) in C++.
@sysosmaster
@sysosmaster 3 года назад
@@neil2444 Well. You do more than just deallocating if you use a GC, also depending on how configure your compiler, your reallocation might even not run when you expect it to… or at all….
@KennethSorling
@KennethSorling 3 года назад
Suggested name for the Baby Stig: Intern Inside
@MagnoLima
@MagnoLima 3 года назад
I really like that! lol ... Intern Inside
@dviljoen
@dviljoen 3 года назад
This comment wins the internet today.
@priyeolise
@priyeolise 3 года назад
I love it
@Aquineas
@Aquineas 3 года назад
I̶n̶t̶e̶r̶n̶ Millennial Inside (FTFY!!)
@DarthFader3000
@DarthFader3000 3 года назад
Eltin
@izzieb
@izzieb 3 года назад
The trailer needs more echo and fire.
@masmullin
@masmullin 3 года назад
To be honest, I coulda used a little more cowbell.
@joho0
@joho0 3 года назад
He borrowed it from a well known spoof. I'd post the link, but my comment will be removed. Just Google Sunday Monster Truck and click the first link.
@UncleUncleRj
@UncleUncleRj 2 года назад
@@joho0 I remember those commercials.... not that one specifically on Google but the "SUNDAY! SUNDAY! SUNDAY!" monster truck commercials were great and very well known... I think I even saw one as near as 3 or 4 years ago for Monster Jam.
@georgesealy4706
@georgesealy4706 3 года назад
I would just like to add that as a contractor engineer I wrote lots of code in both C# and Java. When you go into a situation, most of the time you don't have a choice. A company has its infrastructure, and that is that. So, it's good to learn both, even at home in your 'off time.' Then you can enhance your resume and have more job security.
@ryan-el9er
@ryan-el9er 3 года назад
I’ve been a hobbyist programmer since 2005 (spanning many, many languages) and I am proficient in C#. for some reason, I’ve gone all these years and never obtained experience with Java. I have no intention to work for anyone else and I am curious if you personally enjoy using Java more than C#.
@georgesealy4706
@georgesealy4706 3 года назад
@@ryan-el9er I didn't enjoy one more than the other. The thing I liked about Java was that I could do my work in a Windows development environment and then deploy the code to a Unix/Linux server. That was cool. A number of applications from IBM or Oracle ran on Unix and there was a need to extend them in some manner. Those applications incorporated a JRE, so it was necessary to write the additional code in Java. If you are not working for someone other than yourself or not working with a Unix/Linux server, then you probably don't have to worry about Java. There are some web servers that run on Windows that use Java, such as JRun. So you might run into that situation.
@silencioseu
@silencioseu 3 года назад
7:39 JVM bytecode is indeed jitted, and there's also the HotSpot AOT optimizations.
@JohnDavidDunlap
@JohnDavidDunlap 3 года назад
I was thinking the same thing. If memory serves, Java has had a JIT since the late 90's or early 2000's.
@DavesGarage
@DavesGarage 3 года назад
I still can't find Oracle-sourced info saying, though I implied it HAD to be true at that speed; anything in the JDK docs that show that it JITs to machine code? I believe you but could not find official proof!
@theosib
@theosib 3 года назад
@@DavesGarage I have previously configured the JVM to log the compiling it does so that I could see the x86 code dynamically generated. For blocks of code, it interprets for a while then does a fast compile to run that for a while and then finally aggressively compiles.
@Salzui
@Salzui 3 года назад
@@CurtCox Stuff like -g for debug information into the generated jvm bytecode should be nearly irrelevant, it will just unnoticeably increase loading times, the jvm jit can just ignore that. -target will only check/allow/deny usage of stuff added to the standard library later on, the bytecode did not improve or change really between java 8 and 16.
@gattagattag
@gattagattag 3 года назад
@@DavesGarage The HotSpot VM (released in 99) has been the default runtime for Java since 1.3. Its core feature being just in time compilation. It features a multi-tiered approach to JIT that is significantly more involved than the .NET Runtime. Nowadays GraalVM is of most interest in the JVM runtime world, as it is implemented in java itself and can optimize all aspects of itself (This is not really why it's so revolutionary, but it's very relevant to the JIT conversation). It has many other very analyzes it can perform, but you should read up on it. You should really try to run your benchmark again with GraalVM instead of hotspot, if you were using Java 11 it's already included in your distribution but not enabled. Edit: I forgot about this, but one note about Graal is that, unlike C2, it does not support auto vectorization, and while I have not do not remember what the primes impl you used looks like, I would not be entirely surprised if auto vectorization was performed. Though on the note of vectorization, Project Panama did bring us JEP 414, which adds the ability to describe certain SIMD workloads and have those executed in platform specific hardware
@breckohlson7410
@breckohlson7410 3 года назад
Fast becoming one of my primary tech channels. Thank you for the work and information you pack into each vid. Your blooper real at the end reminds me of writing code, compile error, fix, write more, compile error, fix, rinse repeat lol...great stuff.
@mcneilm76
@mcneilm76 3 года назад
These videos just plain rock!!!! Awesome work and ultimate kudos Dave!!!! (It’s probably worth mentioning that I’ve seen 1000’s of youtube videos and this is probably the third I’ve ever felt compelled to comment on!)
@ViorelMocanu
@ViorelMocanu 3 года назад
Massive respect for the continuous steam of super valuable, in-depth information you constantly churn out during each of your videos! Kudos and keep up the great work, Dave!
@DavesGarage
@DavesGarage 3 года назад
Much appreciated!
@Nusremmus
@Nusremmus Год назад
Couldn't agree more!!
@VeauX1902
@VeauX1902 3 года назад
“The Stieve” could work as a name
@burtonrodman
@burtonrodman 3 года назад
i have to take objection to your description of IDisposable. it does not immediately GC anything… it’s just an opportunity to manually release unmanaged resources. all other GC and reference rules still apply to the remaining managed objects
@SimonBuchanNz
@SimonBuchanNz 3 года назад
With the extra complexity of tracking if the finalization has run or not!
@burtonrodman
@burtonrodman 3 года назад
@@SimonBuchanNz technically it’s tracking if dispose has been called or not so that finalize can be suppressed as an object with a pending finalizer is disqualified from gen0, but point taken
@SimonBuchanNz
@SimonBuchanNz 3 года назад
@@burtonrodman blarg, too long since I've dealt with C# I guess.
@RuiPalmeira
@RuiPalmeira 3 года назад
This. Easy to notice it if you take a look at the resources graph that VStudio provides ( if there's a GC "pass" it will show in the memory graph , and even when you run an IDisposible() method, it will not GC "on demand" ).
@knm080xg12r6j991jhgt
@knm080xg12r6j991jhgt 2 года назад
Doesn't Java's try-with-resources construct do something very similar?
@programorprogrammed
@programorprogrammed 3 года назад
The extra time spent discussing the languages really adds to this series. Thanks Dave!
@DanknDerpyGamer
@DanknDerpyGamer 2 года назад
C# is one of my favorite languages and IMO you articulated (even if briefly), at various points, aspects about the syntactical & technical sides of C# that I love far better than I could when talking with friends about C# haha.
@5lickwi11
@5lickwi11 3 года назад
Really enjoyed the opening. Glad you are doing these videos.
@k_xx
@k_xx 2 года назад
That intro had me in stitches... honestly, much love - all of these videos are so good!
@MeriaDuck
@MeriaDuck 3 года назад
For Java, there are multiple runtimes to choose from. Ibm, Azul, Graal by Oracle, openjdk,... So even the same code can run a bit differently between those.
@SodexGames
@SodexGames 2 года назад
Would love to see it in Graal native image
@robertfrappier699
@robertfrappier699 3 года назад
IDisposable does not reclaim the memory. It's only used to free resources that you don't need anymore like a file or socket connection.
@JheregJAB
@JheregJAB 2 года назад
This is a cool series! I'm a bit disappointed that it seems to only have a few episodes in it, I was really enjoying the language tutorial / discussion followed by the results.
@pelomojado3535
@pelomojado3535 11 месяцев назад
Thats probably cause sone people got salty of their fav languaje being slow, a shame really
@berinloritsch
@berinloritsch 3 года назад
NOTE: Java is runtime compiled, so not necessarily just interpreted. The major distinction between C# and Java is _when_ this compilation happens. Java also has/had hot spot compiling where further optimizations could happen.
@millfreedom
@millfreedom Год назад
And that’s exactly the reason, why Java code should be “warmed up” before testing its real performance: it might show dramatic increase after some methods will be decided “hot” and the optimizations like “inlining” will be applied.
@roycsinclair
@roycsinclair 3 года назад
For a whiteboard grid use Vis-a-Vis markers as you'll remember teachers used with their overhead projectors for the lines, labels etc. That way you have lines that don't erase by accident when trying to update grid contents but when you're done you can wash away with nothing more than a damp cloth. Nothing to do with programming but a useful tidbit to know.
@booganaga123
@booganaga123 3 года назад
I'd love to see the system languages! Rust vs. C vs. C++ etc.
@tiarkrezar
@tiarkrezar 3 года назад
It'd be nice to squeeze D and Zig in there too. Would that be too much for one episode?
@skyletoft
@skyletoft 3 года назад
​@@tiarkrezar Isn't D garbage collected? Or is that optional? (And on that note, according to the library standard, so is C++, it's just that none of the major implementations ever implemented the GC)
@tiarkrezar
@tiarkrezar 3 года назад
​@@skyletoft from what I understand, it allows you to use both manual memory management and GC. That said, maybe you could put D in a group with Swift and Go, that'd be an interesting comparison too.
@dra6o0n
@dra6o0n 3 года назад
Rust is evolving at a steady pace, Microsoft and other tech corporates are kinda interested in it for the security and performance.
@Caesim9
@Caesim9 3 года назад
I think Rust is closer to C++ and think that episode should be C++ vs Rust and Zig is closer to C so their episode should be C vs Zig. D belongs either in the C++ and Rust bucket or would be better in a D vs Go episode'
@peteryates308
@peteryates308 3 года назад
The greatest intro to any video I've ever seen. Excellent work.
@artist6000ish
@artist6000ish 3 года назад
Dave, I think you're confused about the use of the using clause. In the example you stated, using a using clause won't have the effect that you describe. The memory that the garbage collector is hanging on to will still stick around. All that the using clause does is call the Dispose method at the end of the block, and will do so even if there's an exception. You could simulate it using a try/finally. In fact, that's all that the using clause does -- constructs a try/finally for you behind the scenes. It's useful when you want to do something at the end of a block that's deterministic. For instance, let's say that you want to start a stopwatch at the start of a block, and stop it at the end. You can construct an object that does just that: start in the constructor and stop in the Dispose() method which gets called for you automatically. It's also useful, and necessary, as a way to release unmanaged memory, or "free" any other resource that's scarce such as file, sockets, etc. But if you want to actually free memory, you have to ensure there's nothing dangling by setting variables to null, and then call GC.Collect. There's folk-lore out there on calling Collect multiple times to "really really" collect. It's not deterministic, and technically the GC can ignore your Collect call, and do it later if it wants.
@todortodorov940
@todortodorov940 Год назад
Correct. The *IDisposable* is only useful for unmanaged resources (non .Net memory, file handles, etc.), other clean-up operations and some programming patterns. There is NO WAY you can tell the GC to free memory. The GC does this when it decides it is the correct time to do this. Than said, you can force a Garbage Collection, an operation which is expensive and by forcing it, you are probably picking not the optimal time to do this. If you can, you can design your types to be stack allocated (called "value types" or structs), which does not need GC, but this has some limitations. For an advanced scenarios, and this may work in Dave's sieve alg., a reference type object can be stack allocated - but you lose the protections provided by the CLR. And to be honest, a good GC alg. will say: "I see you are doing performing some heavy computations. As there is still plenty of free memory, I will wait reclaiming memory until things cool down.". In other words, the GC should not affect Dave's tests. And if you want to test the alg. alone, just re-write the tests and reuse the memory.
@TheBadassTonberry
@TheBadassTonberry 3 года назад
I mainly program in C#, but I genuinely *enjoyed* working with Java. say what you want about Oracle, but they definitely know how to develop "ergonomic" (for the lack of a better word) products. That being said, I'd go with C# here.
@raianmr2843
@raianmr2843 2 года назад
You're crediting the wrong company here. Java's legacy of being a dumb refuge for inexperienced C++ people goes back to Sun days.
@RetroDawn
@RetroDawn 2 года назад
That is because Sun invented Java and shepherded it for going on 2 decades before Oracle finished their acquisition of Sun. And Oracle didn't purge the Java team (although some left, most notably Gosling himself), and a VT-based Sun veteran leads the Java architecture to this day.
@Dooobs
@Dooobs 3 года назад
Ministig can be called OptimalPrime, because reasons 😄
@CodeJeffo
@CodeJeffo 3 года назад
This channel. Definitely my best discovery of 2021 :)
@limitationsapply
@limitationsapply 3 года назад
10:00 - A classic error here is the use of system time to measure elapsed time. This is a mistake because system time can be changed arbitrarily during execution by network time services or by the user - it can even go backwards. The solution is briefly mentioned at 16:00 - the Stopwatch class. You mention it's more ergonomic, but more importantly it's *monotonic* - it never goes backwards, and it isn't effected by changes to the system clock. Other languages offer similar mechanisms: Java's System.nanoTime, Rust's std::time::Instant, C++'s std::chrono::steady_clock, Ruby's Process.clock_gettime(Process::CLOCK_MONOTONIC), Python's time.monotonic.
@tatianaes3354
@tatianaes3354 Год назад
JavaScript?
@crispoman
@crispoman 3 года назад
Some say he's a piece of dummy code put in to allow a program to run. Some say he's probably not going to get rewritten properly. All we know is: he's called The Stub.
@maighstir3003
@maighstir3003 3 года назад
Now I'm torn. I saw The Stack first, but with that intro, I'm leaning towards The Stub.
@paulfalke6227
@paulfalke6227 2 года назад
The point of view of a BOFH: applications are stubs to make the system load display more interesting. Yes, call the little Intel man "Stub", as nickname for Stubborn!
@aztracker1
@aztracker1 3 года назад
Been thinking it would be interesting to take a wasm target build and test the different web assembly runtimes in a similar way.
@AXYZE
@AXYZE 3 года назад
Would love to see that!
@johnernest8109
@johnernest8109 2 года назад
Took that down to 10000000 iterations 7 zeroes instead of 8 to be nice so that Java wouldn't actually crash with the GC overhead limit error. New Results: C++: 617ms C#: 1285ms Java: 5035ms Yep, that definitely sounds more like real world scenarios I've had with each.
@thomasbagley7142
@thomasbagley7142 3 года назад
Love how this has taken off! I think Buzz would be a great name, it's a single syllable like Stig. What about Bill? Or, perhaps a name in memory of an early computer scientist? Babbage, Ada, Allan, I'm sure you know better. Flowers could be a good one, since he thought to use vacuum tubes and that must have been a large step up in performance.
@killjaqular
@killjaqular 3 года назад
this guy is genuinely hilarious AND has fun doing his videos
@rando5673
@rando5673 2 года назад
I'm not even a programmer, I've only ever written the most basic of code. But even I get the feeling this guy has some extremely deep knowledge and find it fascinating to watch
@DavesGarage
@DavesGarage 2 года назад
Thanks for the kind words!
@MNGoldenEagle
@MNGoldenEagle 2 года назад
Another thing worth noting is that C# does offer the capability to compile natively (foregoing the IL and JIT, at the expense of losing reflection and some other features). Java has explored this capability, but I don't think it exists in the latest version. This could have performance impacts as well and might be interesting to explore comparison-wise.
@runninggames771
@runninggames771 Год назад
What is this feature called? Im un aware of any way of doing this outside of unity’s IL2CPP
@radiosification
@radiosification Год назад
@@runninggames771 It's called Native AOT
@AryzenI
@AryzenI 11 месяцев назад
​@@runninggames771 NativeAOT, I think
@petercooney
@petercooney 3 года назад
Love this show, keep it coming
@michaelpezzulo4413
@michaelpezzulo4413 Год назад
I learned more about programming in the first 13 minutes of this video then the first 4 weeks of class at college.
@RonnyJakobsson
@RonnyJakobsson 3 года назад
Love the intro. Made me smile 😁
@MartijndeBoer
@MartijndeBoer 3 года назад
Featuring the haxe version would be cool, it is a language that needs more love from the world 😊😍
@jarforan
@jarforan 3 года назад
The intro alone is worth a thumbs up. Love it!
@benjamindepaz8429
@benjamindepaz8429 2 года назад
Great video. I’d love to see a comparison of the mobile and UWP language for new windows apps. So Objective-C, Swift, Kotlin, Java and C#.
@keithv708
@keithv708 3 года назад
I loved the intro Dave 😁
@tokiomutex4148
@tokiomutex4148 3 года назад
20:26 the JVM has a JIT compiler
@kozmizm
@kozmizm 2 года назад
According to what I've read and what I understand, back from the days of Java 8 JVM JIT, some of the Java byte-code is turned into raw machine code using the JIT compiler. The interpreter is able to analyze which code is most likely to be used the most, like loops, and it converts it into machine code so that it executes faster. They were also working diligently on adding more and more stuff that will convert into compiled code. Somehow it is able to do this and use a hybrid of byte-code plus machine code running together, passing information between compiled and bytecode with almost no performance loss, in order to make java extremely fast and competitive with compiled languages.
@dunste123
@dunste123 3 года назад
This give me so much insight in how java bytecode actually works, thank you
@keganmillard1030
@keganmillard1030 3 года назад
Dave needs graphs in his videos...
@dpapa2175
@dpapa2175 3 года назад
leaderboard would be nice
@neoncyber2001
@neoncyber2001 3 года назад
I'm not that surprised that Java won this one. The Java Awt 2D API is amazingly fast . Java has been around for as long or longer than any other managed language, and much of that time has been used optimizing the living crap out of the jvm and javac.
@jsteezy80
@jsteezy80 2 года назад
Growing up my step dad worked for intel and somewhere I have some of those Intel bunny suit character that you were showing. Like you said huge advert back in 1991 when they started "Intel Inside" promo. If I can find them I can send you a few. I think I have 10 or so, 2 of each color. Anyway, brought back memories. Keep up the good work
@brucewilliams6292
@brucewilliams6292 3 года назад
The intro is fantastic!!! Thank you Dave!!!! I am stunned by the Java. Bab Stig could be call Baby Stug - Stug Life/ :)
@SpinStar1956
@SpinStar1956 3 года назад
Name him “Stack” 👍
@skyletoft
@skyletoft 3 года назад
That intro was great
@beofonemind
@beofonemind 2 года назад
Looking forward to the next one and the final one. V has got me super interested as being the last language I ever learn.
@joshuavogel861
@joshuavogel861 3 года назад
I feel like I'm learning so much about computer performance from watching these videos. at first I was just curious which language is faster but by detailed comparing of languages there is an understanding of what is common between them and from there a much better understanding what is going on behind the scenes. also very entertaining from an obvious master of the field. this is a gift -thank you sir!
@gwaptiva
@gwaptiva 3 года назад
The unclearest part of the Java code to a Java programmer is the formatting :D
@Brahvim
@Brahvim Год назад
Is it because it uses Allman braces? Ahahaha!
@dhombios
@dhombios 3 года назад
It would be interesting to see the difference between how good the same Java program used in this test performs using JVM and Graal (oracle java aot compiler)
@tulsatrash
@tulsatrash 2 года назад
Man I did not think I would get excited about the code drag racing videos. But here I am.
@Nusremmus
@Nusremmus Год назад
Love this channel. Very informative and that deadpan humor kills me. I would say this guy should be on Carson, or Letterman, but ... well you know.
@skyletoft
@skyletoft 3 года назад
Since you haven't fixed the typo since last episode: Haskell has two Ls
@bitflaker4872
@bitflaker4872 3 года назад
How about calling Baby Stig just "big.LITTLE Bob"?
@Scrawlerism
@Scrawlerism 3 года назад
So excited for more of these let's gooooo
@sujitwarrier4857
@sujitwarrier4857 3 года назад
I subscribed just based on how great that intro was.
@howardwilliams2587
@howardwilliams2587 3 года назад
Now that's an intro!
@Qrzychu92
@Qrzychu92 3 года назад
next group: Scala vs F# vs Haskell
@tokiomutex4148
@tokiomutex4148 3 года назад
Haskell wins
@daschewie
@daschewie 3 года назад
Seeing that F# borrows from OCaml, it would be great to include that in this list.
@alexclark6777
@alexclark6777 2 года назад
F# and Haskell will have completed their runs while SBT is still trying to load.
@jananstunes
@jananstunes Год назад
That intro was AWESOME.
@SebastianMares
@SebastianMares 3 года назад
That intro needs to be paired with JayzTwoCents' iFixit commercial. 🤣
@luisfranciscordg
@luisfranciscordg 2 года назад
I'm a .NET dev, haven't used Java since 2002. I think you should specify which version of .NET you are running your tests, there is massive difference is speed between .NET Framework 1 vs .NET 6. And the same I think could apply to the JVM you're using.
@Quique-sz4uj
@Quique-sz4uj 2 года назад
Yeah we should see this with .NET 6. Also the attribute he uses to heavily optimize the code in C# is probably hurting performance in this case.
@glenh8179
@glenh8179 3 года назад
I'd like to see technical computing languages compared: Fortran, Octave, R, Julia.
@orri93
@orri93 3 года назад
maybe not fair to compare fortran that is compiled to R that is interpret
@0s0n3gr0
@0s0n3gr0 8 месяцев назад
Love the Bunny Man. I had a green one bouncing around for years.
@oceania68
@oceania68 2 года назад
Pretty cool, Java brings back memories of learning it when Sun bought it out on CD with ver 1.1 :D, after learning COBOL & Pascal/Delphi amongst others all those years ago, I've lost most of the skill set as I never kept up with it. Out of all the non-used languages these days, I liked COBOL the most, I resonated with it best. Today, when I have time, I try to learn the R and Ada language for interest.
@willd4686
@willd4686 3 года назад
I see Haskell is on the list. That would be great to see. Or maybe pick some weird ones! SQL sounds nuts!
@knm080xg12r6j991jhgt
@knm080xg12r6j991jhgt 2 года назад
PL/SQL?
@gfdgdfgdfgdfggfdgdfgdfgdfg9709
@gfdgdfgdfgdfggfdgdfgdfgdfg9709 3 года назад
I would like to see how Actionscript2 and 3 run vs Javascript :O
@mensfeld
@mensfeld 2 года назад
Maybe one interesting point regarding Java JIT vs native compilation. There are ways to compile Java code directly into native code via GraalVM. I compared the codes in some benchmarks similar to this one. The most interesting part is, that the native code is not at all faster, like the interpreted (and probably heavily JIT-ed code). The only parts the native version performs better is the startup time and memory consumption. But in raw computation power, not at all.
@ruiztulio
@ruiztulio 3 года назад
Man I wish I could give 2 likes just for that intro! XD will you make some merch with the drag racing event? I'm all in! (specially because you're donating it)
@doctor.davinci.76
@doctor.davinci.76 3 года назад
For a second there I was expecting Jay's face from Jay's Two Cents to appear and for him to start doing one of his iFixit ads
@tonywtyt
@tonywtyt 2 года назад
I'm not a C# programmer, but I appreciated your explanation of the use of uses.
@Nusremmus
@Nusremmus Год назад
If you know Java, you're one inch from knowing C#, which probably started as J++, until Microsoft got sued and lost. And I finally threw my J++ book away just last year :P
@calebvear7381
@calebvear7381 Год назад
His explanation of the “using” statement was actually incorrect. It doesn’t free up memory or anything like that. All it does is ensures that the objects Dispose method is invoked when leaving the block. It is very useful for making sure you cleanup any resources you were using (eg close files, network sockets etc) but does not impact the garbage collection at all.
@JATmatic
@JATmatic 3 года назад
I was putting off subscribing, but after that many explosions, I have no excuses left.
@SilverAura
@SilverAura 3 года назад
Alright so I'm just going to admit right off the bat, I liked this video after the first 2 minutes. If only because you've yet to put out a single video that hasn't taught me something new, fun, and interesting. So there's no way in hell this video can't be worth a like.
@andriesvdwalt
@andriesvdwalt 3 года назад
Made me smile!
@xSugknight
@xSugknight 3 года назад
To be honest i skipped to the results, so i might have missed it: What kind of JVM was used in this experiment? I found the graalVm to be faster by a factor of 2 in many occassions (but not in every)
@bluesillybeard
@bluesillybeard 3 года назад
Probably later than 11, 16 I bet. Not sure though, might say it in the github.
@orbyfied
@orbyfied 3 года назад
he said as a reply that he used JDK 7... bruh
@xSugknight
@xSugknight 3 года назад
@@orbyfied yeah i found it - but thanks anyway
@bluesillybeard
@bluesillybeard 3 года назад
@@orbyfied That's impressive, considering it's score.
@orbyfied
@orbyfied 3 года назад
@@bluesillybeard yeah, but i bet that if he used JDK 16 and disabled the GC or used the new GC flags it would be like so much faster.
@firesoul453
@firesoul453 3 года назад
Looking forward to more.
@DavidWonn
@DavidWonn 3 года назад
I remember loathing those Intel guys in the commercials, mostly because of the time I spent in getting a Pentium III-based PC built, only to see them advertising the IV shortly afterward.
@n-steam
@n-steam 3 года назад
Man am I disappointed. I was rooting for C#, its one of my favourites.
@igorthelight
@igorthelight 3 года назад
Results are strange
@Ruhrpottpatriot
@Ruhrpottpatriot 3 года назад
Don't be, there's a solution (which he didn't show) that has 7883 passes.
@RandalGJunior
@RandalGJunior 3 года назад
This solution he showed has a lot of optimization to be done. Like not using Linq, null checks, spawning threads instead using Parallel.
@Ruhrpottpatriot
@Ruhrpottpatriot 3 года назад
@@RandalGJunior Yeah. It shows some of the really cool C# features that shave of many hours of development time if performance isn't your main goal. Here it's mostly a hindrance.
@RandalGJunior
@RandalGJunior 3 года назад
@@Ruhrpottpatriot C# is a very cool language to write, has a tons of shortcuts and blackboxes. It's very easy to get lazy and leave a lot of performance on the table. It's very fast to have a good running program, but take some effort to have the best.
@michaelday6987
@michaelday6987 2 года назад
C# is and probably always be my language of choice. I am scarred by my experience with Java in college.
@David-id6jw
@David-id6jw 3 года назад
Which version of the bool array did you use for C#? Probably the default version in solution_1? There are three variants on the bool array in solution_1. On my machine (using docker, to match your run), they return scores of 2601 for bool, 3026 for ibool, and 8362 for dbool. Except... I just realized (from a comment you made in the video) there was an optimization I missed in the bool code. Fixing that, the bool version increases from 2601 to 6168, and the ibool version increases from 3026 to 8824. Yes, a stupid speed bump on the hot path slowed things down that much. I'm going to have to update that in the repo. Hopefully you can double-check it before your next video. *Note: the bool version treats the array values exactly like the bitarray version (0 = non-prime, 1 = prime). The ibool inverts the logic so that you don't have to initialize the array twice (since the runtime initializes the array to 0, while the default algorithm requires the sieve to initialize all the array values to 1). Thus the ibool version is a decent bit faster.
@phacus
@phacus 2 года назад
Next: VIm _v._ Emacs BTW, I'm gonna subscribe. Algorithm brought me here 2 times and this is a solid channel. Thanks, Dave.
@Maclabhruinn
@Maclabhruinn 3 года назад
The beauty of Java is that you can take your code and run it on a POWER9 CPU for blistering performance. .NET is mainly (though not exclusively) a creature of the Intel world - where hardware performance is good, but not in the same class.
@theaninova
@theaninova 3 года назад
Java vs Kotlin, Scala, Groovy, Clojure, etc (JVM languages) JS vs TS, Dart, CoffeeScript, Reason, Haxe, Nim, Kotlin etc (JS languages) x86 ASM vs C, C++, Rust, Zig, etc (Low-level languages) JVM Languages vs .NET Languages vs Node Languages (Typical Backend Languages), maybe also include Go, Ruby & Crystal And then functional and mixed functional languages, such as Haskell, F#, Scala, Reason, Kotlin
@grjj09
@grjj09 3 года назад
Although Nim can compile to javascript (and c++ and objective-c), mainly the c-backend is used by people, so Nim is also a low-level language (with garbage collection )
@aztracker1
@aztracker1 3 года назад
JS vs TS once transported is JS. Runtime differences would be more interesting. V8 vs Spider Monkey etc. I'm interested in seeing different web assembly runtimes
@theaninova
@theaninova 3 года назад
@@grjj09 Read somewhere Nim was capable of compiling to JS, if it's mainly used with a C backend maybe add it to Go, Crystal & Ruby instead...
@theaninova
@theaninova 3 года назад
@@aztracker1 True, I included TS for the sake of completeness since it's probably the most popular of them... Different Runtimes would also be interesting, as you said V8 vs Spider Monkey and OpenJDK vs Graal... WASM languages stacked against one another and then compared to JS etc would also be super interesting, yes! Forgot about those.
@VandalIO
@VandalIO 3 года назад
Love this drag race
@mworld
@mworld Год назад
When bench marking c++ / c#/ java code that does a lot of memory allocations (like breadth first search) I saw a vast difference, with c++ coming out on top since pointers rule. This kind of test does not lean on the cpu so much, but rather the languages ability to use as little memory and as few allocations as possible.
@mullergyula4174
@mullergyula4174 3 года назад
Once I ported a piece of complex java code to C and had to work hard for days to get near to the speed of the Java version. JVM's JIT is pretty good. You can beat java in C or even more in assembly if you can design you code to use vector instructions. How often do you need that? You can always do this for the most critical part of the code for most languages.
@c0deventures
@c0deventures 3 года назад
Nothing beats the speed of compiled code. This is a fact and nothing can change that. This proves that your porting of the code hadn't been efficient.
@mullergyula4174
@mullergyula4174 3 года назад
@@c0deventures LOL
@adambickford8720
@adambickford8720 2 года назад
@@c0deventures Good thing Java is JIT compiled!
@jhoughjr1
@jhoughjr1 2 года назад
trying to port a pattern from an interpreted lang to a compiled lang isn't equivalent. It is literally physics.
@evil_me
@evil_me 3 года назад
"he's not the stig, but he is the stigs silicon based cousin"
@c4ashley
@c4ashley 3 года назад
😂👏🏻
@hikaru-live
@hikaru-live 2 года назад
You may want to single out some results (for example, C++ scores) as an integer-only benchmark for the processors.
@alex1520
@alex1520 2 года назад
Not sure why I just had a mental image of "The Architect" in the Matrix movie while listening to Dave speak (when he gets into the nitty gritty stuff) :-) (its a compliment Dave) :)
@tmhchacham
@tmhchacham 3 года назад
Name: Mike Roe Chip
@mysticknight487
@mysticknight487 3 года назад
Could you run the Java using GraalVM or TornadoVM? Both offer compile to native which may increase the number of runs as it speeds up startup time.
@RustedCroaker
@RustedCroaker Год назад
Most of the time AOT compilers produce less optimized code then JIT ones. Because "warmed up" JIT code has an advantage of being constantly profiled on the runtime.
@mysticknight487
@mysticknight487 Год назад
Sure but in this case the startup time may be a large enough portion of the execution time that the JIT optimization doesn't make up the difference in startup time. I guess I should try to compile to native using one of the compilers and run the numbers vs openjdk on my machine to check. I may post an update later today with numbers, otherwise I got tied up in other life to try
@theBoomerDoomer
@theBoomerDoomer 2 года назад
I remember the Intel bunny suit dancers of the 90s... and the subsequent ad campaign that Apple launched for the G3 PowerMacs poking fun at them. Good memories. :)
@onesevenfourone
@onesevenfourone 3 года назад
I know it's a bit of large task to ask but you could compare the ease-of-use and performance when making a 3d render (game) engine in C# vs Java. I'm just curious because I know a lot of game engine programmers started with Java, mostly notably Markus Persson (Minecraft) and there is not really many (at least notable) game engine/ games done in c#.
@klinkclang
@klinkclang 3 года назад
I'd say we call him Sievey Stardust.
@mihiguy
@mihiguy 3 года назад
If you want to see how fast Java (talking about Oracle's implementation) is with only interpreted code, either run it with `-Xint` switch, or attach a debugger and set a breakpoint in every function at some place that is not reached. JIT will not compile functions that have a breakpoint in them. It's horribly slow compared to the JITed version. In fact, there are benchmarks where Java's JIT recompilation will outperform C++ code, but that mostly happens in deep inheritance hierarchies with many virtual functions/methods (due to the fact that on modern CPUs, a "JUMP [register]" instruction is very bad for branch prediction, and JIT will introduce real branches for the most often instantiated objects).
@Scoopta
@Scoopta 3 года назад
Java has been doing JIT basically since the beginning. The first JIT engines were implemented in Java 1.1(3rd party JVM) and 1.2(Sun's official JVM) which were released in 1997 and 1998 respectively. In fact if you run your JVM with -Xint, this disables the JIT engine and forces true interpretation as you suggest, you'll see the massive performance benefit the JIT engine brings. In fact not only does the JVM have a JIT engine it's often considered to be faster and better optimizing than the one in .NET.
@coderider3022
@coderider3022 2 года назад
Like the startup !
Далее
Smart Sigma Kid #funny #sigma #memes
00:26
Просмотров 6 млн
Разоблачение ушные свечи
00:28
Просмотров 736 тыс.
Java vs C# (C Sharp). Что выбрать?
14:40
Просмотров 241 тыс.
How Senior Programmers ACTUALLY Write Code
13:37
Просмотров 1,5 млн
NSAKEY: Who Can See Your Encrypted Data?
12:31
Просмотров 215 тыс.
Blame Me: I Worked on the Windows Progress Dialog!
16:26
Learn Any Programming Language In 3 Hours!
22:37
Просмотров 308 тыс.
Should you learn C++?? | Prime Reacts
20:29
Просмотров 341 тыс.