I have just downloaded a computer game which is around 2GB. My download speed was pretty fast, almost 30mbps. But when it comes to install the game on my computer, why is it that slow? I mean, I don't understand the downloading process because the required folders were downloaded in the blink of an eye, but the installation was not even like 10mbps. What should i know about what is happening on the memory? Where are the files being written on the memory, or are they even? Doesn't installation process have to be as fast as downloading? Thank you for answers.
You are talking about two different things: Installation and Downloading.
Downloading is a process of transferring data from one computer to another over the network. What defines how fast download will happen is performance of the network:
- How fast is connection of both computers and all network via points.
- How busy are network channels currently.
- Overall performance of your system also plays its role in how fast download will happen.
Downloading mostly involves activity of network card and storage devices.
Installation is a process of setting up a piece of software in the way that system can use it properly. This process mostly involves processing and storage device activity. What defines how fast it will happen:
- CPU performance.
- Storage devices performance.
- Amount of RAM can play vital role as well.
In most cases installation of big program will take longer because installation process involves unpacking of install package, copying its content to destination folders, performing necessary system changes (creating registry entries on Windows OS, etc).
So main point is - installation process deals with bigger amount of files than downloading does.
It is easier to download one file (even if it is several GB size) than unpack and copy hundreds of files.
What should i know about what is happening on the memory?
Memory (RAM) is being used as a temporary storage for data which can be accessed faster than data on hard drives. So while installation process is happening most likely operating system will put different parts of the program being installed to RAM.
Where are the files being written on the memory, or are they even?
Such term as Memory is very broad. Memory could be referenced to RAM modules, fast internal CPU cache, swap file, virtual memory. There is difference of how fast different parts of memory can be accessed and how much data can they store. Operating system will do it's best effort in order to utilize memory in best way.
Doesn't installation process have to be as fast as downloading?
If we talk about program with 500kb size install file - most likely install process will happen as fast as download.
If we talk about big program - it is hard to give an answer, because with 56 kb/s network connection it will take a couple of days to download a program and 10 minutes to install it.
Look at this example.
Someone is buying a book from local book store. He get in the car with this book and in 5 minutes he is at home. (This is download process - involved operation with one particle - book).
He starts to read the book. Based on his reading abilities it took 3 weeks to accomplish reading (this is installation process - involved operation with many particles - all the pages).
Or it can be like that.
Someone bought a book and had to walk home all across the city. It took 7 hours to get home from book store. (This is download process - involved operation with one particle - book).
Book was just 10 pages long so it took 20 minutes to read it. (This is installation process - involved operation with many particles - all the pages).
So it can be seen that these two things are pretty independent (though they still have same thing they depend on).
Many games are downloaded over the Internet as a compressed archive, such as a ZIP for or an ISO file (I'm guessing this applies even for game distribution services such as Steam). This process is efficient, because only 1 HTTP request is sent over the network, which means the overhead of transferring the game archive to your computer is very low. Most of the time, the downloaded archive is not stored in memory, but stored in a temporary location on disk.
However, installation is a different story altogether. Installation typically requires the decompression of the archive. There are two factors at play here:
- The speed at which your CPU can decompress the archive
- The speed at which your hard disk can store the decompressed files
The first factor is typically less time consuming than the second. Most modern CPUs should be able to decompress archives at the highest compression ratio at more than 20 MB/s. However, it still occupies quite a large chunk of time, especially if your CPU is slow.
The second factor is even more significant. Most games contain many small files. For instance, texture and audio data may be stored as individual files. There are also many configuration files. Traditional hard disks are very slow at random writes - at times, disk utilization can be 100% but the throughput is only hundreds of KB/s. The amount of data written to disk can actually be significantly higher than the amount downloaded. If your temporary location is on the same disk as the installation location, you do not only have to consider the cost of writing the files, but also reading the archive, and this impacts throughput significantly.
Note that this may not be as significant in the case of Solid State Drives (SSDs).