Good website (application) loads faster, ranks higher in (many) search engines, attracts more (new) visitors, and retains more (returning) visitors
Some (extra) but outdated reading:
Website (application) scalability is related to its performance
After we deal with the performance question, hopefully we are then forced to answer the scalability question:
Does it still perform well when there are more (and more) concurrent users?
Typically, many web application performance drops with more users as illustrated with plot like this
The Network tab of Google Chrome Developer tool is a "built-in stopwatch" to measure website performance
You can view the timeline of events during page load in waterfall view) that can reveal potential areas of improvements
You can also use the "simulated network" drop down list to "simulate" the effect of "slower network" towards your web application performance
In the next few slides, we have a compilation of several known techniques on how to improve the speed of your website (app)
This list is certainly not exhaustive and will continually be improved over time
If you really need to use images, utilize appropriate compression techniques, e.g. JPG (lossy), PNG (lossless), SVG (smaller and scalable, good for simple logo), etc
Do not test your web application's visitors with gigantic images like this exaggerated example
Note that Bootstrap does something similar with its Glyphicons (fonts, SVG, CSS rules)
Exercise: Optimize this before minifying it
Tool: Google Closure Compiler
Note: Keep the development copy (without minification) as you may want to update it later in the future
Network speed is much slower than internal CPU+register/cache memory speed
Use some form of data compression whenever possible when sending data between client and server
Package the data in complex JSON and submit the data in one go instead of sending multiple HTTP requests
Accessing a file in a web server further slows down website (app) performance
Example: A web app needs to dynamically display a table with several columns and the user can choose which column will be the primary sort key
Instead of using SQL ORDER BY command and thus issuing another HTTP request to the back-end database, we can just load the data once from the web server and then do the dynamic sorting of the unchanged data in client's machine using JavaScript
So that the user interface does not get frozen when the server is serving client's request, give visual waiting cues (typically an hourglass) when this happens (but still 'disable' the affected button(s) until the server responds)
Set up your web server so that static content has long cache expiry date that can be leveraged by the client's web browser (unless they are always in incognito mode)
So that the page loading time is roughly equally fast, throughout the world, especially if your website is relevant for many people scattered throughout the world. For an example, see this
First steps: Understand what is the issue, find the bottleneck
If you have the money, spend it to improve the bottleneck component of your web server
HDD | SSD | |
---|---|---|
seek | 4-12ms | <0.1ms |
latency | 2-5ms | 0 |
transfer | 125MB/s | > 540MB/s |
$ | .08/GByte | .60/GByte |
Latency is time between request and response
For disk, rotational latency is time between head on the right track and data rotating under read/wite head
Search for data from higher speed to lower speed devices
Get more network bandwidth
Major issue: This "solution" is mostly NOT in your control, unless you have access to the web server hardware and it can be (very) expensive...
If you use Digital Ocean, there is an 'easy' way to 'resize' your droplet from the cheapest 5 USD/mo droplet to 'faster' or 'bigger' Droplet... with a cost...
This one may seemingly cost less than the obvious solution 1 earlier, but a good software company will pay good $$$ to have good programmers who can do these:
Example: Google does not do heavy page ranking computation when a user enter a new search keyword but just show the results that has been pre-computed earlier
For VisuAlgo translation project, we are thinking of having two versions: the static page (after the translations are confirmed, updated periodically) and the dynamic page (for live translation)
We can consider these alternatives
Again, as with solution 1 (scale the hardware), this solution is mostly NOT in your control unless you understand how to setup web server
Use this or this to check the performance of your web app
My homework: http://www.webpagetest.org/result/170303_T6_6Q5/