The results of the performance evaluation of optimizations added to the VTE (Virtual Terminal Library) and included in the GNOME 46 release have been published. During testing, the responsiveness of the interface was measured in the terminal emulators Alacritty, Console (GTK 4), GNOME Terminal (GTK 3 and 4), and VTE Test App (an example from the VTE repository), when launched on Fedora 39 with GNOME 45 and Fedora 40-beta with GNOME 46. The Alacritty application does not use the VTE library and was chosen as the benchmark, as it has been one of the fastest terminal emulators based on previous tests. A hardware sensor based on a Teensy board was used to measure the time between pressing a button and the information appearing on the screen.
The VTE library provides a ready-to-use GTK widget utilized in various terminal emulators for GNOME, including GNOME Terminal, Console, Black Box, Tilix, Terminator, and Ptyxis. In GNOME 46, the internal structures of VTE have been significantly redesigned, which, according to developers, led to an acceleration of operations with performance increases of up to 40% observed in tests. From a practical standpoint, optimizations have reduced rendering delays in configurations using GTK 4. Previously, latency during keyboard input in Console and GNOME Terminal was noticeable, which deterred many users from using the default GNOME terminal emulators. This issue has been resolved with VTE version 0.76.
Independent testing confirmed a significant reduction in input lag in applications based on VTE, which is observed not only in simple, but also in complex terminal usage scenarios. For example, when using neovim, input delays in VTE-based terminal emulators have reduced to the level of the fastest terminal, Alacritty. Specifically, in a test involving the 'cat' utility, the response time to key presses in Console and GNOME Terminal decreased from 40 to 12 ms, while in a scrolling test in neovim, it dropped from 45 to 23 ms.



The performance boost from using the new version of the VTE library is also noted in the vtebench test suite, which measures not input latencies, but the reading time from the PTY device and parsing performance (scrolling speed and cursor movement tests). In most vtebench tests, the Alacritty terminal outperforms Console and GNOME Terminal, but the lag of the latter is no longer as pronounced as it was before. Part of GNOME Terminal's lag can be attributed to the overhead associated with accessibility support.

Source: opennet.ru
