Understanding the V8 JavaScript Engine

Sdílet
Vložit
  • čas přidán 10. 07. 2024
  • JavaScript is cool (don't @ me), but how can a machine actually understand the code you've written? As JavaScript devs, we usually don't have to deal with compilers ourselves. In this talk, I’ll use visualizations to show you how the JavaScript engine handles our human-friendly code, and compiles it to code that machines understand.
    Presenter: Lydia Hallie
    Event: Reactathon 2020

Komentáře • 106

  • @ahmedhamdy5882
    @ahmedhamdy5882 Před 3 měsíci +18

    I just love these moments of learning when I feel so stupid and my mind feels like oh, we've some work to do.

  • @kelkiiii
    @kelkiiii Před 2 lety +47

    These infographics are really great. Excited to keep studying this. Gonna use this as a resource frequently. Very well-done.

  • @arik_dev
    @arik_dev Před 2 lety +16

    I've been reading through the V8 dev blogs trying to get a sense of what's going on, and this video really tied the concepts together in a succinct way. Excellent use of graphics as well, really helpful.

  • @user-lu7dm2fg2x
    @user-lu7dm2fg2x Před 5 měsíci +3

    The animation was not only cool but also incredibly helpful in visualizing the complexities of the engine. It's rare to find content that's both beginner-friendly and easy to follow, but this video nailed it. Thankyou so much!

  • @satadrubhatt
    @satadrubhatt Před 3 lety +5

    Thanks for the talk and explaining in details. Always liked the visual articles. Kudos

  • @AndreGreeff
    @AndreGreeff Před 3 měsíci +3

    wow... over 20 years of writing JS and I'm still learning new things. definitely going to keep this in mind when designing my functions.

  • @benoitleger-derville6986
    @benoitleger-derville6986 Před 3 měsíci

    This is exactly the video and explanation I've always wanted to see. Thank you.

  • @cingizhemidov6990
    @cingizhemidov6990 Před 7 měsíci

    best info-graphics and explanation I have seen on this very important topic. Thank you

  • @VincentJenks
    @VincentJenks Před rokem

    Excellent illustration! These are key fundamental concepts all JS devs should understand, so as to optimize as much as possible. It takes some of the guesswork out of how you should solve a particular problem, also...seeing as JS is flexible enough to do everything at least 10 different ways. Well done!

  • @ryanpark3523
    @ryanpark3523 Před 2 lety +4

    Lydia~ thank you so much for your wonderful presentation!! You are so much better than Udemy instructor who explains about JS engine. Now finally I can understand how JS works perfectly !!! Thank you so much again !!

  • @VincentDegrave
    @VincentDegrave Před 2 měsíci

    Great way of explaining the internals. Thanks!

  • @rossli8621
    @rossli8621 Před rokem +1

    This is such a great video!!!

  • @daniel7007
    @daniel7007 Před 2 lety

    The best explanation i have ever seen!!!

  • @gorkemokur
    @gorkemokur Před 3 lety +9

    It's a fascinating and informative presentation. Can i ask how did you make slides. I mean, did you use some program or actually, is it a website =)

  • @mumblic
    @mumblic Před rokem

    Maybe the people behind the v8 engine deserve a Nobel price of some kind.
    Code optimization at that low level is really complex and the v8 engine seems to be highly optimized.

  • @omjoshi1748
    @omjoshi1748 Před 2 lety

    Thanks for the explaintion.

  • @yashmishra1024
    @yashmishra1024 Před 3 lety +1

    This was really helpful

  • @manoellopes211
    @manoellopes211 Před 4 dny

    Your content is just amazing 🤩🤩

  • @user-ti2go7ky5u
    @user-ti2go7ky5u Před 24 dny

    perfect. a sua didatica e perfeita, junto dos graficos

  • @josephwong2832
    @josephwong2832 Před 2 lety

    nice visuals and explanations

  • @codeChuck
    @codeChuck Před 3 měsíci

    Deep! And fun 🔥! Turbofan :)
    After watching this video I remembered that I have learned about this V8 optimization previously, but I forgot about this completely when writing actual code!
    Nice reminded that calls to function with different arguments or different shape of object are blocking V8 turbofan optimization.

  • @OliviaGraceDev
    @OliviaGraceDev Před 4 měsíci

    very helpful explanation!

  • @muratwes23
    @muratwes23 Před 2 lety

    most amazing video ever

  • @ddey239
    @ddey239 Před 3 lety +2

    This is awesome

  • @paulsery5878
    @paulsery5878 Před rokem

    Very helpful! Where does Chromium load scripts before byte stream decoding?

  • @nacimallouani4799
    @nacimallouani4799 Před 3 měsíci

    Hi,
    Thanks for the great presentation.
    I was wondering though if we can assume type scripts code is by definition faster than regular javascript since we have more control on shape's number ?

  • @dubola5777
    @dubola5777 Před 3 lety

    Thank you!

  • @pengdu7751
    @pengdu7751 Před 2 lety

    beautiful talk.

  • @DavidAlsh
    @DavidAlsh Před rokem

    I would love to know more about what happens in the browser when it sees JavaScript. When inspecting the performance profiler you can see "compiling" and "evaluating" as two separate tasks - what are they? Does Chrome cache compiled JavaScript between refreshes or only the asset? When it comes to caching, how does Chrome determine between disk and memory cache?

  • @DevsLikeUs
    @DevsLikeUs Před 3 lety

    Awesome talk

  • @conea6891
    @conea6891 Před 3 lety

    Nice, I like it.

  • @manojhk7469
    @manojhk7469 Před 3 měsíci

    high level of explanation

  • @igorf243
    @igorf243 Před 2 lety

    Awesome, thx.

  • @achillesglacia7700
    @achillesglacia7700 Před 4 měsíci

    bloody hell. the ease of that to her is just... For extra beginners will like a complete summarised road map at the beginning before going into each section and function, if that makes any sense, glad to help. you did that, but it was too short, too quick.

  • @systemdeadlock
    @systemdeadlock Před rokem

    Nailed it!

  • @alain_laroche
    @alain_laroche Před 2 lety +4

    This is amazing! Does anyone knows where to find all the others ressources she is talking about?

    • @blyfo
      @blyfo Před 9 měsíci

      Hey, did you manage to find them?

  • @yuxiangchen520
    @yuxiangchen520 Před 3 lety +2

    it's very good.

  • @fsjay
    @fsjay Před 2 lety

    Amazing

  • @roycreativedesigner4608
    @roycreativedesigner4608 Před 4 měsíci +2

    the animation and explanations were helpful....but the cool thing was she was laughing after some seconds and that made ma laugh too......i watched it twice once just to laugh and another time for learning the concept

  • @LostInTheMysteriousWorld

    Where does the global execution context and call stack sit in this whole process?
    I am not talking about event loop.
    I just want to know the v8 part of browser which executes the code.
    Global execution context and call stack is part of v8.
    I find resources in Google explaining v8 architecture and event loop separately.
    In event loop they show that global execution context and call stack is part of v8. And when I go to learn v8 internal process to execute code. I find these type of explaining but no mention of global execution context and call stack.
    I want to know the relation among v8 engine architecture , global execution context and call stack.
    How they work together???
    Besides that I found variables and references are stored in stack and object and function description are stored in heap.
    Some articles says both are stored in memory heap.
    These are confusing.
    What exactly is stack and heap?
    I Googled it.
    It says heap is not part of heap data structure.
    And stack is a data structure.
    I want to know the relation among stack, heap and hardware RAM.
    Is stack and heap is a physical part of ram?
    = If I consider ram is just a collection of billions of memory block. Some are used as a process called stack and some are used as a process called heap.
    If this is truth then the same memory block can be used as a stack and heap in two different process or case !!!?
    All these are so confusing.Is there anyone who knows about it?? I am tired of researching in Google.

  • @danielkrajnik3817
    @danielkrajnik3817 Před 3 lety +8

    7:18 it surely is

  • @shahtaz9385
    @shahtaz9385 Před rokem +1

    What do I have learn to understand this?

  • @RaviPrakash-qj2lz
    @RaviPrakash-qj2lz Před rokem +1

    There is no mention for call stack, memory heap or event loop in this video. What's their role in this whole process?

    • @gFamWeb
      @gFamWeb Před rokem

      To my knowledge, call stack works pretty similar to any other call stack. Memory heap is similar. Event loop is something that really depends on if you're using Chrome or Node.

  • @liamconverse8950
    @liamconverse8950 Před 2 lety +1

    So with just in time compilation what is the purpose of compiling to a byte code before compiling to machine code? If optimization means compiling straight to machine code why not do that all the time?

    • @abdelrahmankhalil
      @abdelrahmankhalil Před 5 měsíci

      "bytecode takes a lot less memory than machine code."
      Stackoverflow a/69155309 (because yt hates urls)

  • @elvispalace
    @elvispalace Před 10 měsíci

    just love

  • @MinorMood
    @MinorMood Před 3 lety +11

    Well - the part that really broke my brain was that gear animation on 4:42 ))) There is definitely something wrong there!))
    Aside from that - a great video, thanks a lot!)

    • @hankchinaski6533
      @hankchinaski6533 Před 3 lety +3

      Bytecode: easy peasy
      Gears broking physics laws: what tha hell!!!

  • @vnm_8945
    @vnm_8945 Před 3 měsíci

    does typescript help with optimizing?

  • @samferrer
    @samferrer Před 3 lety +2

    Lovely presentation!! if you do not have courses on Udemy ... you should ...

  • @vishwateja2801
    @vishwateja2801 Před 11 měsíci

    Can anyone help me understand where are the registers located? on the pc? is my understanding correct?

    • @artahir123
      @artahir123 Před 3 měsíci +2

      registers are located in a machine/pc/computer

  • @subtlespace
    @subtlespace Před 8 měsíci

    When you say "we"... I presume you mean "computers"! 😂 Seriously though, very comprehensive video... thank you 😵‍💫

  • @ihateorangecat
    @ihateorangecat Před 6 měsíci

    Somebody please tell me what tool she used in the video to illustrate code executions. 😢🙏

    • @ricardomejias7957
      @ricardomejias7957 Před 2 měsíci

      Leaving this here to hopefully get a notification when you get an answer :v

  • @drapala97
    @drapala97 Před 3 lety +8

    this is pretty cool. I wish it was a little bit slower though

  • @praveenseela9259
    @praveenseela9259 Před 2 lety

    i still didnt understood how JS (one programming language) is able to call c++(another programming language). can you throw some light on it?

    • @SirusStarTV
      @SirusStarTV Před 2 lety +1

      I know how, the predefined browser API methods are defined as objects in c++ and they connected to c++ functions in js engine specific way, when they're called their corresponding c++ functions are called. When you console.log(setInterval)
      it prints [native code] because there's a mechanism that JS engine developers implemented to connect the invoking of js functions to call real machine code functions.

    • @SirusStarTV
      @SirusStarTV Před 2 lety +1

      There's a mechanism for invoking operation system functions in Java language too, through mechanism called JNI. You can also embed Python in your "c" programs.

    • @praveenseela9259
      @praveenseela9259 Před 2 lety +2

      Any links you have to understand this in deep?

    • @heraldo623
      @heraldo623 Před rokem

      This is called binding. V8 is written in C++, it has ways to bind C++ functions to JS objects. When this JS function is called it results in a underlying call to C++ code. V8 dispatches the call since it's also running on C++.
      The same call can be done to different languages, but both languages must agree on a calling convention/interface. Search Foreign Function Interface.

  • @friggindoc
    @friggindoc Před rokem +1

    A very charming tutor explaining things excellently

  • @samarthkeskar8546
    @samarthkeskar8546 Před 3 lety +2

    00:58 😂 😂😂😂😂😂😂😂😂😂😂😂😂

  • @Sunil_KumarDas
    @Sunil_KumarDas Před 2 lety

    So fast for me btw. Will have to watch multiple times to understand.

  • @phamhoa5590
    @phamhoa5590 Před 3 lety +3

    principle of program language, such a nightmare

  • @xKreesherZ
    @xKreesherZ Před 3 lety

    bonk

  • @bild96
    @bild96 Před 3 lety +2

    Hard for me to understand

  • @SweepAndZone
    @SweepAndZone Před 3 měsíci

    My 3rd time watching this

  • @1Eagler
    @1Eagler Před 3 lety

    So, v8 creates Virtual cpu with virtual memory?

  • @tubbystubby
    @tubbystubby Před 9 měsíci

    Just take a tub of popcorn and put V8 source code on auto scroll.
    Great video though.

  • @TheWhateverChannell
    @TheWhateverChannell Před 2 lety

    my head hurts

  • @dennystreet2454
    @dennystreet2454 Před 6 měsíci

    I wish I could have the same topics in the kitchen with my wife while drinking coffee 😮

  • @sumitbopate5010
    @sumitbopate5010 Před 2 měsíci

    A❤

  • @punchthedog
    @punchthedog Před 2 lety

    This is clearer at 0.75 speed.

  • @JimmyKama
    @JimmyKama Před rokem

    Seems like you're joking/kidding. I wish you could explain assuming all the viewer as beginners. Anyway, great info.👍

  • @sebastiansaiz9173
    @sebastiansaiz9173 Před 2 lety

    No entendí una goma.

  • @Plesiosaur-ig2si
    @Plesiosaur-ig2si Před 3 lety +1

    i love you

  • @BrunoSouza-wy2et
    @BrunoSouza-wy2et Před 2 lety +5

    I would learn way more if there was only a voice teaching how this stuff works

  • @0xhhhhff
    @0xhhhhff Před 4 měsíci +1

    Why are people here reducing the instructor's skill and presentation effoet only to her looks? Lol its a good vdo too surface level but nice infographics

  • @bd8063
    @bd8063 Před 2 lety +2

    Isnt she streaming from bathroom lol

  • @captainpissof9632
    @captainpissof9632 Před 3 lety +22

    why is she in the bathroom for this?

    • @pannihto7588
      @pannihto7588 Před 3 lety +4

      She was taking a dump

    • @chudchadanstud
      @chudchadanstud Před 2 lety +3

      @@pannihto7588 This. The V8 engine eats up a lot of RAM. All that RAM has to be unloaded somewhere.

  • @homyeeking997
    @homyeeking997 Před 2 lety +2

    I can't help watching the speecher

  • @bobfarker4001
    @bobfarker4001 Před 11 měsíci

    So that's why modern browsers can't run on 4GB of RAM when a 3d game like WoW could run on 500MB...

  • @Patryk-wm9fs
    @Patryk-wm9fs Před 2 měsíci

    you know "spaces over tabs" when you see her

  • @waseemakram8778
    @waseemakram8778 Před 2 lety

    What kinda gibberish was that?

  • @barrydunn7190
    @barrydunn7190 Před 3 lety +48

    Can anyone tell me what I was supposed to learn here, I was starting at the cute smart girl on the left

    • @proviptk
      @proviptk Před rokem

      Lmao

    • @dan_bev
      @dan_bev Před rokem

      SIMP

    • @bboyakers
      @bboyakers Před 8 měsíci

      Stop being creepy dude....just stfu and learn.

    • @mattmcmahon8311
      @mattmcmahon8311 Před 7 měsíci

      Lame comment. Couldn’t even read it cuz I was distracted by the picture of an idiot on the left.

    • @fatimanura6359
      @fatimanura6359 Před 5 měsíci

      😂😂😂😂 same

  • @shagging8727
    @shagging8727 Před 3 lety +4

    I can't focus on the right.

  • @shohanshohag987
    @shohanshohag987 Před 2 lety +3

    i love this video , girl are so cute

  • @energy-tunes
    @energy-tunes Před 4 měsíci

    Whats so funny i really dont get it shes literally holding herself from bursting into tears throughout the entire video?

  • @davidgrig4608
    @davidgrig4608 Před 2 lety

    this presentation is useless and painful for me because I cant concentrate on code my brain stuck, the reason is the the angel with charming eyes and voice on left side of the screen. I think this should be a real problem for dev guys who work with such a good programmer and beautiful hot woman.

  • @mikem.8702
    @mikem.8702 Před 2 lety

    As someone once said, if you don't know how to explains to others, your knowledge isn't useful. There're so many steps you're missing. Please learn to explain better.

    • @heraldo623
      @heraldo623 Před rokem

      The video is obviously an introduction to core principles of the V8 interpreter but assumes the watcher has basic knowledge about interpreters. As so implementation details are ignored since it wasnt the goal.

  • @user-nu1si5ys5c
    @user-nu1si5ys5c Před 4 měsíci

    Excellent content. Though I don't know why it's a bit hard to focus