How to use the React Profiler to find and fix Performance Problems

Поділитися
Вставка
  • Опубліковано 28 вер 2024

КОМЕНТАРІ • 80

  • @shivroy652
    @shivroy652 5 років тому +44

    Dude. You are beautiful. You know what developers want to see. One of the best video on react profiler. to the point no more non-sense .

  • @Jrrs2007
    @Jrrs2007 2 роки тому

    This was great!!!!! More guidance on the tools!!!!!! Please 😁

  • @petrosc7608
    @petrosc7608 Рік тому

    great video, thanks a lot

  • @victorfigueiredo6031
    @victorfigueiredo6031 Рік тому +1

    Excelente vídeo, me ajudou demais!

  • @jivkojelev3744
    @jivkojelev3744 4 роки тому +4

    Is there any special setting for render count ? I don't see the count in my profiler.

  • @nxshipon6470
    @nxshipon6470 2 роки тому

    Josss sir Thanks YOU

  • @jamesfoo8999
    @jamesfoo8999 3 роки тому

    Thanks :) The text documentation just wasn't sinking in.

  • @cryptonative
    @cryptonative 4 роки тому

    Hi Ben. Thanks for this very informative video. What’s the name of cocktail app you are optimizing in this video?

  • @TheNishant30
    @TheNishant30 Рік тому

    1:41
    that's what she said.

  • @ShumiGupta
    @ShumiGupta 5 років тому +2

    Can you provide the chrome extension you used to get react in developer console tab? I used react developer tool extension using which I am not able to get total number of times component renders.

    • @bawad
      @bawad  5 років тому

      Make sure you have the latest version of react

    • @ShumiGupta
      @ShumiGupta 5 років тому +1

      @@bawad thanks for the reply. Yes I have latest version of react and react developer tool but it looks like they have made some changes in recent version now they are not showing the number of times component got rendered. I haven't got chance to check the change log will check and if I found something I will post the reason here. If you got to know something about this please share it with me.

    • @ShumiGupta
      @ShumiGupta 4 роки тому

      They have made multiple changes to optimize performance. So I would recommend all to review change log as they have mentioned all the changes made.

  • @jamesherrero7334
    @jamesherrero7334 4 роки тому +1

    @5:53 you uses a short cut to delete only that one word, how???

  • @popuguytheparrot
    @popuguytheparrot 5 років тому +1

    why are you using HOC withStyles if in v4 add useStyles hook

    • @Deliverant
      @Deliverant 5 років тому +5

      It's not his application i presume

    • @bawad
      @bawad  5 років тому

      Yep

    • @popuguytheparrot
      @popuguytheparrot 5 років тому

      @@bawad can you do video about effector.js ?

    • @bawad
      @bawad  5 років тому

      at some point yes

    • @MikeyHogarth
      @MikeyHogarth 5 років тому

      It's my app (hi Ben - I nearly had kittens when I saw this vid) - easy answer to this is that v4 wasn't out when I started, it came out mid-project - plus I'm not in the habit of just hookifying everything just because there's an API for it, sometimes it's advantageous to use HoC's.

  • @IvanLeshchenko-q1w
    @IvanLeshchenko-q1w 5 років тому +38

    best video about react profiler for now. nice and simple. thank you!

  • @kidShibuya
    @kidShibuya 4 роки тому +3

    Super confusing because that action took 154ms but everything in the profiler says less than 3ms?... The CocktailBrowser says it took just .7ms?...

  • @gabrielloubier8662
    @gabrielloubier8662 4 роки тому +5

    This is not useful anymore as there is no "total render" count in react dev tools

  • @jguix
    @jguix 3 роки тому +16

    Thank you, that was a really concise and good explanation on how to use the profiler and interpret flame graphs, just what I was looking for.

  • @cubiq1
    @cubiq1 5 років тому +9

    7:54 The Chip component's color prop will not be strictly equal (===) when its parent (IngredientPicker component) re-renders because of the inline function. This could potentially trigger a re-render of _all_ mapped Chip children whenever IngredientPicker re-renders. Same goes for the onClick handler prop. Surely these inline functions should be removed before relying on things like React.memo()?

    • @bawad
      @bawad  5 років тому

      good point

    • @umnajdi
      @umnajdi 2 роки тому +1

      I didnt get what you mean. can you explain more?

    • @samuelaraujo9099
      @samuelaraujo9099 Рік тому +2

      @@umnajdi basically, when you define a function like () => yourAnotherFunctionCall() inside a props, you are creating a new ref, so everytime parent component rerender the reference will be different, so child component will rerender

    • @serenestrolls-d7b
      @serenestrolls-d7b Рік тому +1

      @Mayank Ramina Dont create inline functions. Create named functions and use useCallback hooks to memoize them.

    • @billyfigueroa1617
      @billyfigueroa1617 Рік тому

      Great video!!! I’ll be using this for work. Hopefully we are on the right version so the profiler shows up

  • @TuanNguyen-vk4fu
    @TuanNguyen-vk4fu 4 роки тому +6

    Thank you, Ben. The best video explanation for profiler in react.

  • @cristiantorres853
    @cristiantorres853 2 роки тому +1

    how to use the lazy loading as you mentioned?

  • @samartajshaikh2601
    @samartajshaikh2601 2 роки тому +2

    This is really one of those which everyone wants to know about but don't know where to start. Thanks for this video. 👍

  • @kirillzlobin7135
    @kirillzlobin7135 9 місяців тому

    Profiler is apparantly very useful thing

  • @ShawnRice-eg3il
    @ShawnRice-eg3il 4 місяці тому +1

    Great rundown. Thanks!

  • @VerySadBatman
    @VerySadBatman 4 роки тому +8

    This was awesome! I'd really love to see how you structure your React app to scale. Please do a video on that 🙏.

    • @bawad
      @bawad  4 роки тому +3

      Are you talking about folder structure?

    • @VerySadBatman
      @VerySadBatman 4 роки тому +1

      @@bawad Yes. Folder structure; where you decide put things like components, contexts, tests, and how they all come together.

    • @bawad
      @bawad  4 роки тому +3

      ua-cam.com/video/M4rYfq5foPA/v-deo.html

    • @blyfo
      @blyfo 2 роки тому +2

      this is a great question

    • @md.mashnoorsaifkarim3453
      @md.mashnoorsaifkarim3453 Рік тому

      @@blyfo I second that

  • @zoladkow
    @zoladkow 2 роки тому

    granted, this vid is about a workflow with profiler, but the most prelevant message i think gets across is to just throw more memo here and there 🤷😁

  • @vinayadiga1674
    @vinayadiga1674 6 місяців тому

    Thanks Sir!

  • @tyrrelldavis9919
    @tyrrelldavis9919 3 роки тому

    Yo I'm having the same problem with redux atm.
    Am on Linux, seems like it's a function that keeps running itself forever or something.
    Makes my entire computer freeze after a little bit of time.
    Hopefully will be fix by end of today.
    Ben is one of best js UA-camr, much abundance quality & humor

  • @speculativesapient7139
    @speculativesapient7139 Рік тому

    How do you get the extra information for components about total renders, props etc.? It seems the default setup doesn't provide that information.

  • @tegaogheneovo5881
    @tegaogheneovo5881 3 роки тому

    Oh shoot exactly what I need, been at this for a whole day bro trying everything this is a fairly standard approach..thanks😔 lol ask Ben first

  • @arvindvs8934
    @arvindvs8934 3 роки тому

    Is there a tutorial video for the cocktail app shown in this video? Can someone please guide

  • @HaibertBuilds
    @HaibertBuilds 3 роки тому

    You should make the same video for react native!

  • @beeenthere
    @beeenthere 5 років тому +2

    Thanks for this! Really helpful.

  • @neeraj1bh
    @neeraj1bh 3 роки тому

    Is the Profiler API from docs and Profiler Tab in Dev Tools same.

  • @aqua123670
    @aqua123670 5 років тому +2

    awesome, thanks

  • @sushmitakumari8252
    @sushmitakumari8252 Рік тому

    Outstanding.. this is what I expected 😊

  • @luanecarolineaquinocavalca1064

    thank you! very well explained

  • @pawanmittal6166
    @pawanmittal6166 3 роки тому

    Awesome Video with superb explanation.

  • @cebuch.
    @cebuch. 2 роки тому

    very helpful and packed with only needed info

  • @yusf1945
    @yusf1945 Рік тому

    Thanks man. This is really good one

  • @nbaua3454
    @nbaua3454 3 роки тому

    Best content on your channel..keep it coming

  • @HOLONIA4EVER
    @HOLONIA4EVER 2 роки тому

    Very useful, thanks.

  • @ankitmehrotra8519
    @ankitmehrotra8519 4 роки тому

    Hey Ben..Great video as usual. A small request for video for optimization of javascript app, react app, code splitting.

  • @hiteshagja24
    @hiteshagja24 3 роки тому

    Video volume is very low.

  • @segevitsky
    @segevitsky 3 роки тому

    Cool video thanks!

  • @punisher013
    @punisher013 3 роки тому

    excellent! thanks man

  • @markhyoutube
    @markhyoutube 2 роки тому

    Fantastic performance guide, many thanks!

  • @DrNoxer
    @DrNoxer 4 роки тому +2

    When you pass callbacks or raw objects to the components and you're doing it directly on it: blabla={() => ...} or blabla={{ ... }}, those fail the comparison check of react, since objects and functions get a new address and the JS comparision compares the addresses, making: {a: 10} == {a: 10} be false, therefore, for raw objects you should useMemo() and for raw callbacks, useCallback()

  • @deepwebtube
    @deepwebtube 3 роки тому

    Great inputs sir!

  • @mohammadalioruji4025
    @mohammadalioruji4025 3 роки тому

    cooool

  • @rhidlor8577
    @rhidlor8577 3 роки тому

    Thanks

  • @TheOrlstefano
    @TheOrlstefano 4 роки тому

    Great video. Really helpful. Thanks a lot

  • @arvindvs8934
    @arvindvs8934 3 роки тому

    Is the app in this video using Material UI?

    • @w1pe0ut
      @w1pe0ut 3 роки тому

      Yes ,it is. (Material UI for React, of course)

  • @shirshak6738
    @shirshak6738 5 років тому +1

    nice :) Seems like everybody should use at least to get insight how performant their app is running.

  • @christiangyaban9666
    @christiangyaban9666 5 років тому +1

    nice one