Okay. So in the beginning, my name is Gil. I'm a software engineer at Wix, and in Wix I'm a part of the viewer team. In the viewer team we develop the application that renders Wix websites. So whenever a user goes to a Wix website, our application runs and renders the website.
So in the last two years I'm leading the performance team where we try to find and also, of course, solve performance issues in Wix websites. Going back to this graph, today I want to talk about the journey that we went through. Before I dive into the project and the solutions of how we actually improve the performance of Wix websites, I want to begin by explaining the problems that caused us to have such low results and, of course, user experience, and then also, of course, explain the solution that fixed those problems.
It is important for me to tell you that none of those problems and solutions that I'm going to talk about are specific to Wix. None of them are actually Wix-specific. Maybe, in the beginning, I will start with an example from our application, but very fast I will also talk about why I think those problems and also those solutions can be found and implemented in any web application. I will talk about it more later. So, like I said earlier, there are many things that we did and also that anyone can do to improve the performance of web applications in general, but today I want to focus on the most important and impactful thing we did. We implemented many, many, many different solutions, but the thing that I'm going to talk about is actually the biggest project. It was the biggest project that we implemented. It's also, I think, the hardest problem that we solved, because it's not some lines of code that you can add to your application. By solving this problem, it actually requires more of a change of the architecture of the application. We had to rewrite many parts of our application in order to solve this problem. It's not something that is just changing a few lines of code and just everything resolved. It required a big change, and usually, most applications require a bigger change. Today, I want to tell you how we dramatically decreased the amount of JavaScript that we sent to Wix websites. This is what I'm going to focus on today.
For those of you who are less familiar with this problem, you can see how much JavaScript an application is downloading and executing in the browser by going to the network tab in the browser dev tools, and on the bottom side, you can see you have the transfer size of the JavaScript. On the JavaScript tab, you can see the transfer size and the resource size. Both are important, the difference between them are the compression of the JavaScript, whatever is downloaded is compressed, and the browser is uncompressed and executed, so usually a few times the resource size that the browser is executing is in most cases bigger than the transfer size, about 3, 4, 5, it really depends on the code.
So, first of all I want to talk about why JavaScript size is actually a problem, what caused us to have such a big amount of JavaScript that actually caused us to have a lot of performance issues, so I want to touch on exactly what in our code was actually the problem. And I'm going to give example of one feature in one component to demonstrate this problem, but then of course I'll explain why this problem happened in all over our code. And also of course how it's a very common issue in many applications. So, I'm going to start with a simple example, it's the example of one feature that we have in a button component, and it's the feature that allows our users when they add buttons, like I said Wix is a platform for creating websites, or you can add components and you can add features to those components, so in this example it's the link feature of the button component, you can define where you want the page to go, which page, or whatever you want to happen when the user clicks the button, actually the user of the website. So, like you see in this panel, you can choose what to do when the button is clicked, in case of link, of course, you want to link to somewhere, you can link to page, you can link to external web address, you can link to an email, a phone number, open a lightbox, you can do many things, in case of a page link, you can choose which page to navigate to and also how to open it, so many options, you can choose to configure this link object.
Comments