This guide describes what could be causing performance bottlenecks and provides tips on how to improve the performance of your computer.
A fast computer saves time and improves user productivity. Computer freezes harm productivity since they interfere with the user's workflow. Because there is nothing to do during a computer freeze, the brain emerges from its productive deep work state, and might start thinking of unwanted distractions. Computer lags could also cause unpredictable gesture accidents such as an unwanted drag-and-drop operation. If a computer freezes during a drag and drop operation, the user has to hold the mouse button and wait until it is unfrozen to avoid dropping an item like a file or folder in a wrong place.
One might click on a location on screen that will have a different effect after the computer unfreezes because something moves or a window is opened/closed, or a keyboard press is not registered. For example, when starting to drag a file and then pressing CTRL during the freeze, it might not register the CTRL press and end up moving the file instead of copying it. Or one might open a program, then do other tasks while the program is loading. If it takes too long to load, it might pop up in a moment where one is not paying attention, which could lead to unwanted clicks, keystrokes, and interruption while writing.
If a computer is lagging or freezing, this is likely caused by exhaustion of the system memory (RAM), processing power (CPU), and/or disk latency.
Contributing factors can be too many tabs open in a web browser that does not unload unused tabs from memory, too many tasks running in background, an active file transfer, and software bugs.[1]
The "bottle neck" metaphor is derived from the thinnest (lowest-diameter) point of a drinking bottle, which slows the flow of water in the entire bottle. The metaphor can better be applied to water tubes.
The capacity of the system memory is among the most important things for a computer's performance.
Not only does it store running programs, but a higher capacity allows for more caching, meaning the operating system copies locally stored data to the RAM where it remains so long as the space is not needed by running programs themselves, allowing them to be accessed much faster from there. This reduces the need for memory paging (if activated), a process that is both weary on the disk and slow, both on hard disks and solid state memory. On hard disks, it also reduces the need for random read access which would also add wear and latency.
The system memory is also used for write buffering, meaning data to be written to a data storage device is first stored there to prevent blocking read requests, which have a higher priority.
In web browsers, more RAM allows for more tabs' content to remain in memory so it can immediately be recalled if the tab is opened. When a browser detects that the system memory is getting exhausted, it might unload the page content of tabs that have not been opened for the longest time. When the tab is opened again, the browser needs to download the page content from the server again, which adds a delay.
Note that capacity is more relevant for performance than the recency of the technology. For example, 32 GB of DDR3 RAM usually improve performance more than than 16 GB of DDR5. An exception may be some high-end video games that don't need enough memory to exhaust the smaller RAM capacity. However, those are usually more dependent on the video memory (VRAM). Note that a computer only supports one type of memory. For example, a computer can not support both DDR3 and DDR4, and the physical design of the memory slots differ.
If the operating system's partition is nearly exhausted, not only could failed writes lead to loss of data and user preferences for programs not optimized for such condition, but the performance will suffer, since the operating system has to fragment files more aggressively.
Since the reading head of hard disk drives has to move to the location of the data to access it, many programs requesting many files at random locations in a short amount of time could cause noticeable lags.
This becomes especially relevant when files are being transferred in background. The hard drive's magnetic head has to quickly alternate between the file transfer task and data requested by other programs.
Some components such as the CPU or data storage might temporarily stop responding to prevent it from overheating.
If the computer is fan-cooled, it might be spinning to slowly. This could be caused by misconfiguration on a custom-built computer.
Thermal throttling is particularly an issue with live USB operating systems, where the operating system is run off a small flash drive which is not designed for such a workload.
Thermal performance throttling is prevalent in smartphones due to their compact form factor and limited cooling options.
Too many active background processes deteriorate performance since they take up processor cycles, and might affect disk latency if they read from and write to the disk as well.
Tabs can be unloaded without being closed by terminating the browser's web content sub processes.
Browser caching stores static page elements on the local drive to speed up page loading. Usually, it should not be deactivated. However, it might improve performance to deactivate the browser cache on a live USB operating system to decrease the workload, which prevents temporarily blocking I/O requests to prevent overheating. But it increases the amount of internet traffic consumption, since static resources like style sheets and scripts need to be downloaded repeatedly from the server. However, on a landline Internet connection, that difference should be marginal and insignificant.
xdotool
automation tool. (AskUbuntu (February 25th, 2022); Unix and Linux Stackexchange (March 5th, 2019); GitHub (November 5th, 2021); BleepCoder (September 10th, 2012))