Why JavaScript performance matters most and how we deliver it?
One one of our core principles is to deliver the highest quality with the best performance you can get, but how can we guarantee this? Let’s split it up in two core topics.
Nowadays data transmission size and performance are very important parts of websites. Visitors, your customers expecting that you are always online and of course, fast. It’s not an advantage if you can deliver these expectations, it’s more like you must deliver it per default if you want to have a successful website. Not only search engines are ranking your site regarding speed, also users evaluate your site within the first seconds. The first impression counts, typically you don’t get a second chance. Googe Speed in Mobile Search
I want to address a few types of JavaScript performance problems. Because if you integrate our snippet in your website you want to be sure that we deliver the highest performance for your website.
1. JavaScript size and execution time
I think you will agree if I assume your webpage has more than one javascript file included. Of course, JavaScript is the part which allows your website to become dynamic and it allows to deliver the best user experience to your customers. But the more snippets and code you include in your site, the slower your site gets. So be careful which plugins you include and which not.
The browser executes JavaScript in one single thread and so it's very important to keep the execution time very slow, because at each JavaScript execution the website is blocked.
Typical JavaScript Performance Problems
1. DOM interactions
Interacting with the DOM (with the user interface) is one of the most expensive parts of JavaScript execution time.
Our script keeps the DOM interactions as small as possible, that you don't recognize any impact on your website.
2. Caching
As in any other programming language, caching is as much important as in JavaScript. Especially in JavaScript caching objects of the DOM can give you an huge performance increase. Because as I wrote in part 1, DOM interactions are one of the most expensive parts.
Chatvisor uses a sophisticated object caching technology which allows a high performance execution of the JavaScript code while keeping the memory usage low.
3. Inefficient callbacks
As I wrote before, JavaScript is executed in one single thread. That means, if an callback is executed asynchronously, it blocks the whole website. Which logically results in keeping your callback execution time as low as possible, that the user doesn't recognize any blocking time of the user interface.
Chatvisor is optimized for performance and because of its dedicated caching technology, it is possible to execute any callback in a very efficient way.
4. Synchronous Script Loading
Every synchronous script which is loaded blocks the rendering of the browser. So make sure that mostly every script can be loaded asynchronously or deferred.
You can embed our scripts asynchronously or deferred. It doesn't matter.
2. Traffic/Bandwidth usage
There are two reasons why the traffic/bandwidth usage of your website is important. Firstly, since a few years the website accesses from mobile devices have outperformed desktop devices. Because of the reason, that the bandwidth on mobile devices is more limited and more expensive than on desktop devices, it becomes more and more important to reduce the traffic. Secondly, images are downloaded in parallel (not synchronous as described before) and the JavaScript snippet should not slow down your image loading time because it uses that much amount of traffic.