{"id":1437,"date":"2018-10-23T07:23:06","date_gmt":"2018-10-23T07:23:06","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=1437"},"modified":"2018-10-24T02:54:11","modified_gmt":"2018-10-24T02:54:11","slug":"essential-system-tools-alacritty-hardware-accelerated-terminal-emulator","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/23\/essential-system-tools-alacritty-hardware-accelerated-terminal-emulator\/","title":{"rendered":"Essential System Tools: Alacritty &#8211; hardware-accelerated terminal emulator"},"content":{"rendered":"<p>The first tools under the spotlight were <a href=\"\/essential-system-tools-ps-mem\/\">ps_mem<\/a>, a small utility that accurately reports memory consumption of software, and <a href=\"\/essential-system-tools-gtop-system-monitoring-dashboard-terminal\/\">gtop<\/a>, a system monitoring dashboard. The third tool we showcased was <a href=\"\/essential-system-tools-gtop-system-monitoring-dashboard-terminal\/\">pet<\/a>, a simple command-line snippet manager. These utilities are console-based. This time we switch to a graphical utility. It\u2019s a terminal emulator called Alacritty. But it\u2019s different to most terminal emulators.<\/p>\n<p>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.<\/p>\n<p>The software is written in Rust, a popular programming language among developers. For example, Rust won the most loved language in Stack Overflow\u2019s Developer Survey for the past 3 years.<\/p>\n<h3>Installation<\/h3>\n<p>My preferred way of installing software is to compile a program\u2019s source code. For my Arch Linux distribution, I installed a few packages first.<\/p>\n<p>sudo pacman -S cmake freetype2 fontconfig pkg-config make xclip<\/p>\n<p>Then it\u2019s just a matter of cloning the software\u2019s repository and building the software with cargo, Rust\u2019s package manager. Cargo makes it easy to get up and running by downloading a Rust project\u2019s dependencies, compiling the project, making packages, and more.<\/p>\n<p>git clone https:\/\/github.com\/jwilm\/alacritty.git<br \/>\ncd alacritty<\/p>\n<p>cargo build &#8211;release<\/p>\n<p>If you\u2019re so inclined, there\u2019s a snap available. And many popular distributions carry a package for the software.<\/p>\n<h3>In operation<\/h3>\n<p>Let\u2019s go through a simple test to see how Alacritty performs in practice. Alacritty boasts that it\u2019s the fastest terminal emulator available. Defining \u2018fastest\u2019 is subjective. Are we measuring the software\u2019s latency? Or the completion of a basic test such as the ability to scroll text in the shortest time?<\/p>\n<p>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:<\/p>\n<p><a href=\"https:\/\/www.linuxlinks.com\/wp-content\/uploads\/2018\/10\/Alacritty-time.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lxer.com\/wp-content\/uploads\/2018\/10\/Alacritty-time.png\" alt=\"Alacritty\" width=\"1120\" height=\"326\" \/><\/a>Click image for full size<\/p>\n<p>As you can see, Alacritty completes the test in the quickest time. It\u2019s 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.<\/p>\n<p>With the same set terminal emulators, let\u2019s see how much memory each emulator consumes at startup in their default configuration, using the ps_mem utility.<\/p>\n<p><a href=\"https:\/\/www.linuxlinks.com\/wp-content\/uploads\/2018\/10\/Alacritty-memory-comparison.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lxer.com\/wp-content\/uploads\/2018\/10\/Alacritty-memory-comparison.png\" alt=\"Alacritty\" width=\"1120\" height=\"326\" \/><\/a>Click image for full size<\/p>\n<p>Alacritty consumes the most memory. The default installation sets the scrollback buffer to hold 10,000 lines. You can reduce the software\u2019s memory consumption by lowering the number of scrollback lines. Ideally, we\u2019d like to see dynamic memory allocation, as it can be helpful to have a large scrollback buffer in some situations while minimizing memory consumption.<\/p>\n<p>Features of Alacritty include:<\/p>\n<ul>\n<li>The software deliberately pares features to the bone. For example, tabs or splits are not offered. There\u2019s no audio bell.<\/li>\n<li>Uses a system\u2019s dedicated GPU to improve performance.<\/li>\n<li>Supports scrollback with definable number of lines to scrollback, together with control of the number of lines scrolled (faux scrolling).<\/li>\n<li>Option to open URLs on click.<\/li>\n<li>save_to_clipboard configuration option for copying selected text to the system clipboard.<\/li>\n<li>Support for the LCD-V pixel mode (vertical screens).<\/li>\n<li>Supports scancode-based key bindings.<\/li>\n<li>Support for bitmap fonts.<\/li>\n<li>Preliminary support for Wayland.<\/li>\n<li>Cross-platform support \u2013 runs under Linux, macOS, FreeBSD, and OpenBSD. Windows support is planned.<\/li>\n<\/ul>\n<h3>Summary<\/h3>\n<p>Alacritty is a useful terminal emulator. While its features are frugal, it\u2019s designed to be used together with other software such as <a href=\"\/tmux\/\">tmux<\/a>. It supports the Unix philosophy of composability, where components can be selected and assembled in various combinations to meet a user\u2019s preferences.<\/p>\n<p>It\u2019s important to remember that Alacritty is in a fairly early stage of development. The developers consider the code to be alpha quality.<\/p>\n<p>Website: <a href=\"https:\/\/github.com\/jwilm\/alacritty\">github.com\/jwilm\/alacritty<\/a><br \/>\nSupport: <a href=\"https:\/\/github.com\/jwilm\/alacritty\/wiki\">Wiki<\/a><br \/>\nDeveloper: Joe Wilm, Christian Duerr, and many contributors<br \/>\nLicense: Apache License 2.0<\/p>\n<p><a href=\"http:\/\/lxer.com\/module\/newswire\/ext_link.php?rid=261818\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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\u2019s a terminal emulator called Alacritty. But &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/23\/essential-system-tools-alacritty-hardware-accelerated-terminal-emulator\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Essential System Tools: Alacritty &#8211; hardware-accelerated terminal emulator&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1437","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=1437"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1437\/revisions"}],"predecessor-version":[{"id":1500,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1437\/revisions\/1500"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=1437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=1437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=1437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}