The first tools under the spotlight were ps_mem, a small utility that accurately reports memory consumption of software, and gtop, a system monitoring dashboard. The third tool we showcased was pet, a simple command-line snippet manager. These utilities are console-based. This time we switch to a graphical utility. It’s a terminal emulator called Alacritty. But it’s different to most terminal emulators.
Linux has lots of terminal emulators. What distinguishes Alacritty from the vast majority of terminal emulators? It differentiates itself by offering GPU-acceleration combined with a minimal feature set.
The software is written in Rust, a popular programming language among developers. For example, Rust won the most loved language in Stack Overflow’s Developer Survey for the past 3 years.
Installation
My preferred way of installing software is to compile a program’s source code. For my Arch Linux distribution, I installed a few packages first.
sudo pacman -S cmake freetype2 fontconfig pkg-config make xclip
Then it’s just a matter of cloning the software’s repository and building the software with cargo, Rust’s package manager. Cargo makes it easy to get up and running by downloading a Rust project’s dependencies, compiling the project, making packages, and more.
git clone https://github.com/jwilm/alacritty.git
cd alacritty
cargo build –release
If you’re so inclined, there’s a snap available. And many popular distributions carry a package for the software.
In operation
Let’s go through a simple test to see how Alacritty performs in practice. Alacritty boasts that it’s the fastest terminal emulator available. Defining ‘fastest’ is subjective. Are we measuring the software’s latency? Or the completion of a basic test such as the ability to scroll text in the shortest time?
For simplicity, I compared the software with other popular terminal emulators, seeing how long it takes each emulator to scroll through 100MB of text. Here are the results:
As you can see, Alacritty completes the test in the quickest time. It’s about twice as quick as kitty, another GPU based terminal emulator. Most non-hardware accelerated terminal emulators lag behind in the test, although there are a few notable exceptions. I also tested a dozen other terminal emulator (results not shown, which were comparable with the results for Terminator and GNOME Terminal etc.), and Alacritty remains top. Different types of text manipulation tests also yielded similar results.
With the same set terminal emulators, let’s see how much memory each emulator consumes at startup in their default configuration, using the ps_mem utility.
Alacritty consumes the most memory. The default installation sets the scrollback buffer to hold 10,000 lines. You can reduce the software’s memory consumption by lowering the number of scrollback lines. Ideally, we’d like to see dynamic memory allocation, as it can be helpful to have a large scrollback buffer in some situations while minimizing memory consumption.
Features of Alacritty include:
- The software deliberately pares features to the bone. For example, tabs or splits are not offered. There’s no audio bell.
- Uses a system’s dedicated GPU to improve performance.
- Supports scrollback with definable number of lines to scrollback, together with control of the number of lines scrolled (faux scrolling).
- Option to open URLs on click.
- save_to_clipboard configuration option for copying selected text to the system clipboard.
- Support for the LCD-V pixel mode (vertical screens).
- Supports scancode-based key bindings.
- Support for bitmap fonts.
- Preliminary support for Wayland.
- Cross-platform support – runs under Linux, macOS, FreeBSD, and OpenBSD. Windows support is planned.
Summary
Alacritty is a useful terminal emulator. While its features are frugal, it’s designed to be used together with other software such as tmux. It supports the Unix philosophy of composability, where components can be selected and assembled in various combinations to meet a user’s preferences.
It’s important to remember that Alacritty is in a fairly early stage of development. The developers consider the code to be alpha quality.
Website: github.com/jwilm/alacritty
Support: Wiki
Developer: Joe Wilm, Christian Duerr, and many contributors
License: Apache License 2.0