In fact, the latest release of Angular, we shared last month, is the biggest we've ever shared. And there is way more to come. We shared many advancements, including a brand new Reactivity model, which is 100% backwards, compatible and also interoperable with the current Reactivity model. We shared improvements in our service side and dozens of quality of life improvements.
I would like to talk about the Reactivity model. But before this, let me give you a quick overview of how Angular reflects data changes in the view right now. For the past seven years or so, Angular has been using a compiler, which takes templates like this and translates them to efficient JavaScript instructions that can render your components pretty quickly. Here, you have your component tree. At a certain point, you may make an update in the state of your components. When the browser's microtask queue is empty, Angular's runtime will traverse this entire component tree and check every single binding within your templates. If any of these bindings have changed, Angular will update the view associated with it.
It's great that the framework updates only what has changed, right? But at the same time, it traverses this entire component tree by default. You might be thinking, wait, this might be extremely slow. Well, it's not that bad. The reason for Angular being fast is that it is designed with monomorphism in mind. In other words, it is optimized for your JavaScript virtual machine. This is an excellent article by Misko, who is the CTO at builder.io, where he developed a framework called QUIC. Before he joined builder.io, he was one of the technical leads for Angular at Google. You can find this in the JavaScript benchmarks comparing different frameworks. I respect the implementation of these benchmarks, and it is also really hard to build realistic examples and benchmarks, and it's even harder to judge about the performance of a framework based on manipulation of tables. But well, as a framework, which has never been optimized for this set of benchmarks, Angular performs still pretty well here. It's close to the middle, and outperforms some very popular alternatives. I have removed their names because I just really don't want to create any drama here. If you look deeper here, you'll see that Angular performs really well on almost all the benchmarks except one, swapping roles. Currently, we're working on improvements of our control flow, which includes conditional statements, and also loops directly in the templates. We're going to take into consideration the role swapping and expect updates in the next couple of months. When we improve this, the benchmarks are going to move from where they were to about third place in the framework section, which I consider a pretty satisfying result.
All right. Now, let us go back to the changes in the reactivity model that Angular experienced. Let us assume that we have the exact same component tree as we saw.
Comments