How slow is MediatR really?

Поделиться
HTML-код
  • Опубликовано: 23 янв 2022
  • Check out my courses: dometrain.com
    Become a Patreon and get source code access: / nickchapsas
    Hello everybody I'm Nick and in this video I will investigate a claim around the library MediatR and how it can affect your application's performance. This video will also introduce you to performance measuring and memory profiling techniques.
    Don't forget to comment, like and subscribe :)
    Social Media:
    Follow me on GitHub: bit.ly/ChapsasGitHub
    Follow me on Twitter: bit.ly/ChapsasTwitter
    Connect on LinkedIn: bit.ly/ChapsasLinkedIn
    Keep coding merch: keepcoding.shop
    #csharp #dotnet #mediatr

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

  • @nickchapsas
    @nickchapsas  2 года назад +109

    Something that I forgot to mention in the video is that, when you add some IO into the mix (database call, api call etc) the difference will get even smaller because the IO will loadbalance it out of the equation.

  • @jradplowman
    @jradplowman 2 года назад +8

    Nick your videos are pure gold. Your presentation and pacing are perfect. Also your approach is so easy to follow! Thanks again for the great content.

  • @JesseTemple
    @JesseTemple 2 года назад +24

    We use MediatR in a production environment with good results, but I never got this far down into the weeds about it. This was a very interesting video, thanks!

  • @kjbetz
    @kjbetz 2 года назад

    Great thorough tests, explanations, and video! Thank you!

  • @pablocom
    @pablocom 2 года назад

    Super interesting how it affects in terms of memory allocation, thanks again Nick!

  • @ergis8004
    @ergis8004 2 года назад

    Very informative video. Learned about the profiling tool too. :)

  • @arkord76
    @arkord76 2 года назад

    Thank you for this extraordinary example!

  • @thomas5540
    @thomas5540 2 года назад +2

    Thank you for putting so much effort into it. I learned a lot from this video.

  • @RENAUDADAM
    @RENAUDADAM 2 года назад +3

    Hey Nick, awesome to see a video on this content! As always really well done :). I agree that the benefits of MediatR generally speaking outweigh the performance cost. That said, the memory allocation issue related to the service can almost be completely removed by making the service a singleton, if your use case permits. It would be interesting if MediatR also allowed you to register handlers as singletons.

  • @amrosamy8232
    @amrosamy8232 2 года назад

    Perfect demo 👌

  • @bormokov
    @bormokov Год назад

    very good evidences bro, thanks for best clarifications

  • @RusslanK
    @RusslanK Год назад

    Hi Nick! Thanks for the nice videos & material you make & provide to the public :)

  • @ThiagoFer93
    @ThiagoFer93 2 года назад +37

    I feel like most developers are always seeking the best practices overall and forget to ask what is the best for their situation, which can lead to hard to handle cannon that is used to kill an ant.

  • @josepvg
    @josepvg 2 года назад +1

    Thanks for a great video. I think when you add some IO bound code to the sample this overhead becomes minimum and I also think in 99% of cases doing such low level optimization as using services instead of the Mediatr makes the code more complex. It is then much more difficult to maintain, bugfix and refactor for high level optimization

  • @manishwalde3424
    @manishwalde3424 2 года назад

    You are awesome Nick 👍🏼

  • @HenriqueGraca
    @HenriqueGraca 2 года назад

    Great content!

  • @airjordanx
    @airjordanx 2 года назад

    your content is good. thanks

  • @gettoecoding1058
    @gettoecoding1058 2 года назад

    Very very cool video ! Super interesting.

  • @denys-p
    @denys-p 2 года назад

    Honestly, I like this video much more than many others. Mostly because of conclusion “always measure and then make decisions”.

  • @diadetediotedio6918
    @diadetediotedio6918 Год назад +2

    I think many people have a hard time understanding that not everything is about raw performance, if that were the case we would only write with low-level languages like ASM, C or Rust. We use high-level languages because we want to increase the readability of our code as much as possible and reduce human error at the maximum possible rate, the objective with this is to make the product something agile to develop and with a low error rate. If you worry too much about performance trying to cut costs, you will end up impacting your bottom line and making those lower costs less valuable in and of themselves.