The sound for this video was “enhanced” with Adobe Enhanced Speech. While it removed all the noise and made the voice clearer, there are definitely some glitches.
setting the array length is a pretty nice solution if you want to shrink your array, but without wanting to get an array containing your deleted values which is what the splice method does
Array length is even weirder than that, actually: if you set it it changes the array length to that, but it doesn't actually create the elements in-between. If you do that same example in v8, it will print as [, , , ] to make clear that the element slots are not filled. Because reading a missing element still gives you an undefined, this doesn't matter most of the time, until you try to enumerate it with for in /of directly: at which point it will not enumerate any values. Ugh.
I could see the JIT bytecode becoming unwealdy at some point when covering all the different fast-paths, i.e. each instruction generating a lot of machine code. I wonder what the performance would be like emitting a single jitted routine that is jumped to vs emitting all the fast-path logic each time. Especially if there are multiple heavy instructions in a block. Alternatively, it may be interesting to see if checks can be elided/streamlined across instructions. For example, with the simple loop.js you could elide int32 checks in several places, so you would only need to check for overflow. I wonder if it would be possible with the current architecture to front-load the int32 type checks so they are not part of the loop/hot path, or to jump to the point after the types have been checked.
I wish you could revert to the old sound as this video's audio is very unpleasant to listen to, at least to me sounds kinda like low bitrate MP3. Anyway, awesome video as always!
Yeah, tried using "Enhance Speech" from Adobe after multiple people recommended it. It's definitely a bit different but my voice sounds "clearer" which I like.
@@awesomekling don't know your definition of clear, because it basically chopped off lots of the highs and made it a bit distorted to my ears ¯\_(ツ)_/¯ but tbf both sound clear to me
This is such a fun series! What do you think about another approach: let the interpreter run but instead of executing each instruction it generates a function call into an in memory C/C++ file. After "interpreting" a JS file in such a way you could get the benefits of an optimizing C++ compiler while also avoiding code duplication as you could just reuse the C++ functions the interpreter is using internally. We just gained A LOT of optimizations for free, avoid duplicate work and can't really introduce bug in the JIT. This needs a moderately fast C++ compiler of course :) This seems very maintanable to me! Keep up the work, it's always a pleasure :)
I suppose you could, but that only covers the case where the values are indeed identical. You still need more specific checks to determine equality in both the true/false cases. :)
@@kreuner11 you can change the behavior of any object with `Symbol.toPrimitive` when using == + - * / ** etc. It's like a less powerful form of operator overloading.
Idea: For loose equality, if the bit patterns are the same, then the values must be equal for *any* type. So you could do that check without even looking at the type. Then, if the bit patterns are different, figure out the types and do more checks.
This filter on you voice sounds like I've got way too much earwax built up. It's kind of unpleasant to listen to. Feels like I got extra pressure in my ears.
The sound for this video was “enhanced” with Adobe Enhanced Speech. While it removed all the noise and made the voice clearer, there are definitely some glitches.
Aw mann
WHF :-) the voice is super clear, like in anachoic chamber. it sounds a bit wierd as there is no echo/reverb. great video too
I was thinking like wait what is with Andreas voice 😊
Minecraft zombie noise at 15:11 😅
it's definitely better on the clarity side, kind of odd tho that there's *no* echo etc? also somewhat monotonic (well, yknow - "more" monotoic).
One always learns something new, didn't know the array length property in JS is this magical. Love the series.
I think that's the only case I ever came accross of a length property that's settable... How do people come up with these ideas 😂
setting the array length is a pretty nice solution if you want to shrink your array, but without wanting to get an array containing your deleted values which is what the splice method does
I've been wondering... how's the speedup from the fast path so high when the profile wasn't showing that high percentage for the array length stuff?
Amazing video and performance speed ups! The first run after the array length fast path from 2.1 to 0.8 was beautiful. 🤯
Array length is even weirder than that, actually: if you set it it changes the array length to that, but it doesn't actually create the elements in-between. If you do that same example in v8, it will print as [, , , ] to make clear that the element slots are not filled. Because reading a missing element still gives you an undefined, this doesn't matter most of the time, until you try to enumerate it with for in /of directly: at which point it will not enumerate any values. Ugh.
I could see the JIT bytecode becoming unwealdy at some point when covering all the different fast-paths, i.e. each instruction generating a lot of machine code. I wonder what the performance would be like emitting a single jitted routine that is jumped to vs emitting all the fast-path logic each time. Especially if there are multiple heavy instructions in a block.
Alternatively, it may be interesting to see if checks can be elided/streamlined across instructions. For example, with the simple loop.js you could elide int32 checks in several places, so you would only need to check for overflow. I wonder if it would be possible with the current architecture to front-load the int32 type checks so they are not part of the loop/hot path, or to jump to the point after the types have been checked.
I wish you could revert to the old sound as this video's audio is very unpleasant to listen to, at least to me sounds kinda like low bitrate MP3. Anyway, awesome video as always!
Awesome video! But sound worse for sure. at 34:02 for example
How will it be possible to profile the jit machine code that is currently just shown as one block in the profiler?
different mic sound makes you have lower pitch voice because of the missing high formants lol
Yeah, tried using "Enhance Speech" from Adobe after multiple people recommended it. It's definitely a bit different but my voice sounds "clearer" which I like.
@@awesomekling don't know your definition of clear, because it basically chopped off lots of the highs and made it a bit distorted to my ears ¯\_(ツ)_/¯ but tbf both sound clear to me
Yeah sounds weird in this video. Especially 't's sound muffled
This is such a fun series! What do you think about another approach: let the interpreter run but instead of executing each instruction it generates a function call into an in memory C/C++ file. After "interpreting" a JS file in such a way you could get the benefits of an optimizing C++ compiler while also avoiding code duplication as you could just reuse the C++ functions the interpreter is using internally. We just gained A LOT of optimizations for free, avoid duplicate work and can't really introduce bug in the JIT. This needs a moderately fast C++ compiler of course :) This seems very maintanable to me! Keep up the work, it's always a pleasure :)
I believe at one point Apple used LLVM inside JavaScriptCore for exactly that reason.
the voice sounds weird? like muffled
I personally didnt notice the difference in sound until reading the comments
Really good speed up! Thank you for video ❤
6:14 have any of these others been implemented yet? Also amazing progress so far!
10:20 can't you do an identity compare in all cases as a super simple fast path no matter the types?
I suppose you could, but that only covers the case where the values are indeed identical. You still need more specific checks to determine equality in both the true/false cases. :)
Yes, even if the values are identical, they may not compare equal, like NaN. Are there user-definable magical methods in JS as well?
@@PelleReimersI don't think you can do operators in JS
@@kreuner11 you can change the behavior of any object with `Symbol.toPrimitive` when using == + - * / ** etc. It's like a less powerful form of operator overloading.
@@kreuner11you sort of can with Symbol.toPrimitive / valueOf(). It's pretty constrained, though.
Your desktop wallpapers are amazing! Where do you get them?
I'm making them with DALL-E
Idea: For loose equality, if the bit patterns are the same, then the values must be equal for *any* type. So you could do that check without even looking at the type. Then, if the bit patterns are different, figure out the types and do more checks.
Ah no this doesn't work for NaN :(
@@briancarroll4211 You could do that first and then if they are not equal do the special casing for special types/values like NaN.
@@msclrhd NaNs are not equal even if they have the same bit pattern. The NaN check must come first.
👍
Is it me or is your voice quieter than last video? Maybe a result of the adobe edit
This filter on you voice sounds like I've got way too much earwax built up. It's kind of unpleasant to listen to. Feels like I got extra pressure in my ears.