Is it worth it to call Rust from Python with PyO3?

Поделиться
HTML-код
  • Опубликовано: 29 дек 2024

Комментарии • 14

  • @davidmurphy563
    @davidmurphy563 23 дня назад +2

    That was very cool.
    Perf_counter() is more accurate for measuring performance btw.

    • @ekbphd3200
      @ekbphd3200  22 дня назад

      Thanks! I’ve started using it rather than time(). Thanks for the feedback.

    • @davidmurphy563
      @davidmurphy563 21 день назад

      @@ekbphd3200 Ah, it's just one of those "good practice" things devs tell other devs that probably doesn't change very much! :)

  • @SBrown-ou1xl
    @SBrown-ou1xl 5 месяцев назад +1

    That's a really cool project! Thanks for bringing it to our attention!

    • @ekbphd3200
      @ekbphd3200  5 месяцев назад

      No, no, thank you!

  • @zhaoziyang-c5h
    @zhaoziyang-c5h 5 месяцев назад +1

    This was great, thanks! Had no idea this was available. Going to implement it into my python ebook reader

    • @ekbphd3200
      @ekbphd3200  5 месяцев назад

      You're welcome! Best of luck!

  • @paulmairo
    @paulmairo 2 месяца назад +1

    Nice video, this comes in handy as I was indeed asking myself what use cases warrant reaching to PyO3. I am wondering though, if we convert the call `out_dict.get(w, 0)` to a "dummy" `if w in out_dict` won't it be faster? Something I also find missing here in the video is the memory and CPU (cores) usage. Not that I think Python would do better there, but it would be interesting to check.

    • @ekbphd3200
      @ekbphd3200  2 месяца назад

      Great ideas! I’ll try these ideas in a future video.

  • @j-p-d-e-v
    @j-p-d-e-v 5 месяцев назад +1

    Nice video, the speed boost from Rust is almost twice. Can you do polars and pandas performance comparison?

    • @ekbphd3200
      @ekbphd3200  5 месяцев назад +1

      Thanks! Yeah, Rust wins again. Ah, interesting idea. I'll have to try that comparison at some point in the future.

    • @RatafakRatafak
      @RatafakRatafak Месяц назад +1

      I dont think 2x performance speedup is worth handling two languages