I wrote Neural Networks in 6 Different Languages to See the Fastest

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ม.ค. 2025

ความคิดเห็น • 38

  • @EgorProkhodtsev
    @EgorProkhodtsev 18 วันที่ผ่านมา +3

    Man, you’re doing some really cool stuff, definitely my inspiration to get out and do something too! Keep the ball rolling!!!

  • @mxqrdz
    @mxqrdz 18 วันที่ผ่านมา +1

    Let's goooo was waiting for this

  • @SkegAudio
    @SkegAudio 18 วันที่ผ่านมา +10

    for rust, make sure you want to have it run with the "--release" profile for the most optimized/performant build

  • @requestfx5585
    @requestfx5585 10 วันที่ผ่านมา +2

    Would have been nice to visualize the data better

  • @haleemhawkins8112
    @haleemhawkins8112 18 วันที่ผ่านมา +2

    I started my first Full stack SWE role 6 months ago after CS undergrad. Best way I can describe typescript is a way to get client side JS code to behave closer to server side code and eliminate a lot of errors/bugs before run time. TS doesn’t really exist (as the seniors say lol), it just compiles to JS. I’m surprised how fast Typescript was too on this

    • @scorsoneenterprises7230
      @scorsoneenterprises7230  18 วันที่ผ่านมา

      @@haleemhawkins8112 great point. I was also really surprised how fast it was

    • @tonyhart2744
      @tonyhart2744 16 วันที่ผ่านมา +2

      "I’m surprised how fast Typescript", ". I’m surprised how fast V8"
      here is the corrected comment

  • @-NguyenDuyTanA-mh1db
    @-NguyenDuyTanA-mh1db 18 วันที่ผ่านมา +5

    bro a chad to code a neural network in cpp

  • @sprightly106
    @sprightly106 15 วันที่ผ่านมา +1

    Will you provide the updated Rust results?

    • @scorsoneenterprises7230
      @scorsoneenterprises7230  15 วันที่ผ่านมา

      @@sprightly106 I’ll find a way to have it provided. Someone did a pull request on the repo and got the Vanilla rust to 0.06 and the enhanced to 0.03. Gotta figure out how I want to merge it

  • @rafaabreu5563
    @rafaabreu5563 17 วันที่ผ่านมา +1

    Bro, I am taking a look at your content and everything seems pretty cool, how did you start with quant engineering?

    • @scorsoneenterprises7230
      @scorsoneenterprises7230  17 วันที่ผ่านมา +1

      @@rafaabreu5563 hi. I’m glad you think it’s cool. I started trading, then I learned some programming and after I found out I can code my own strategies I was hooked

    • @rafaabreu5563
      @rafaabreu5563 17 วันที่ผ่านมา +1

      ​@@scorsoneenterprises7230I just starting, any resource recommendation?

    • @scorsoneenterprises7230
      @scorsoneenterprises7230  17 วันที่ผ่านมา +1

      @@rafaabreu5563 Books like Fooled By Randomness and The Misbehavior of Markets. Quant news letters for code that is what it is, like no need to over engineer. And learn different parts of linear algebra, calc, and topology and then if you need help with the programming use an LLM to ask it questions, but better to not have it write you any code. And my channel of course :). Hope that helps.

    • @rafaabreu5563
      @rafaabreu5563 17 วันที่ผ่านมา +1

      @@scorsoneenterprises7230 thx a lot

  • @seasong7655
    @seasong7655 17 วันที่ผ่านมา +1

    There's now a way to turn off the GIL in python 3.13, if you need it

    • @scorsoneenterprises7230
      @scorsoneenterprises7230  17 วันที่ผ่านมา

      I just saw that today actually. Could make the language really interesting now thank you for the tip though :)

  • @vikraal6974
    @vikraal6974 17 วันที่ผ่านมา +4

    57:12 Results

  • @kinkard7493
    @kinkard7493 16 วันที่ผ่านมา +2

    Lol, debug Rust build beats Python!

  • @Heater-v1.0.0
    @Heater-v1.0.0 16 วันที่ผ่านมา +2

    There is something very wrong here. Your results for Rust are an order of magnitude too slow. I suspect you did not run a release build "cargo run --release". Even then when checking out your repo and building the rust and c++ I find the Rust is much slower. There is no reason the Rust and C++ versions should not be running at almost the same speed. I suspect you have taken a huge performance hit by using all that iter, enumerate, map, lambda stuff in Rust rather than normal for loops and indexed addressing as you do in C++.

    • @scorsoneenterprises7230
      @scorsoneenterprises7230  16 วันที่ผ่านมา

      @@Heater-v1.0.0 i bet you’re correct my friend. This was my first rust project.

  • @thisisbstar7
    @thisisbstar7 17 วันที่ผ่านมา +2

    Why compare different code structures while using third-party libraries in one language but not the other? Even for the same task, using different third-party libraries is unfair. In Python, you used NumPy (which is written in C and highly optimized), but in Rust, you used nested Vec types instead of a comparable third-party library like ndarray. This comparison is unfair to Rustaceans, as it doesn't showcase Rust's true potential. Seeing Rust at the bottom of the performance chart feels disappointing and misleading.
    A fair comparison would either avoid third-party libraries entirely or use equivalent ones in both languages. 😒

    • @carnap355
      @carnap355 17 วันที่ผ่านมา +1

      he did not benefit from numpy lmao. Look at his train method he still manually loops through each number instead of using numpy operations. It would be faster if he used python lists

    • @scorsoneenterprises7230
      @scorsoneenterprises7230  16 วันที่ผ่านมา

      Yeah I agree that I didn’t really benefit from numpy. This was the first thing I wrote in rust

    • @scorsoneenterprises7230
      @scorsoneenterprises7230  16 วันที่ผ่านมา

      @@thisisbstar7 if you have the time and care if you fork the repo and redo the rust I’d be happy to learn from you

  • @msakg
    @msakg 16 วันที่ผ่านมา +1

    Rust code is unfair.
    You using OpenMP on CPP code which is true parallelism library and Tokio in Rust which is just a async runtime.
    You cloning everything. You shouldn't do that instead you can access your objects through shared pointers (Arc/Rc) and Interior mutability tools like Mutex if you need to mutate.

  • @ballackuk13
    @ballackuk13 17 วันที่ผ่านมา +2

    you are doing something wrong in rust

  • @chrboesch
    @chrboesch 3 วันที่ผ่านมา

    If you're going to benchmark and you don't know much about some languages, you should at least figure out how to disable debug mode. It's on by default in both Rust and Zig. Otherwise, it's all a bit ridiculous.