I was just curious how fast can a terminal window (in X) get a refresh draw. So I wrote a script to test, termfps.sh
. It prints characters to fill up the whole window by default, then reset the cursor to home using ANSI escape code. Print again, doing so for 100 times by default. 100 / elapsed time is the FPS.
I ran several tests using ./termfps.sh 1000 80 25
. I used 80 by 25 because that's my VT's terminal size, and I maximize window before I run the test. Here are the results:
urxvtc For 80x25 1000 frames, elapsed time: 9.126 seconds Frames per second: 109.574 urxvt For 80x25 1000 frames, elapsed time: 9.140 seconds Frames per second: 109.401 urxvtc + tmux -2 For 80x25 1000 frames, elapsed time: 11.214 seconds Frames per second: 89.173 urxvtc + tmux For 80x25 1000 frames, elapsed time: 10.546 seconds Frames per second: 94.813 xterm For 80x25 1000 frames, elapsed time: 16.487 seconds Frames per second: 60.653 urxvtc, no .Xdefaults For 80x25 1000 frames, elapsed time: 8.882 seconds Frames per second: 112.580 urxvtc + tmux -2, in right panel of two For 80x25 1000 frames, elapsed time: 10.568 seconds Frames per second: 94.616 vt1 For 80x25 1000 frames, elapsed time: 54.984 seconds Frames per second: 18.187 lxterminal For 80x25 1000 frames, elapsed time: 39.211 seconds Frames per second: 25.502
The slowest one is vt1, I didn't test framebuffer. urxvt is my terminal, but I also have xterm installed. I installed lxterminal for vte-based terminal test. My normal urxvt uses Rxvt.font: xft:Envy Code R:style=Regular:size=9:antialias=false
. I ran more on urxvtc, invoked without .Xdefaults
, so I could test without changes I made. Since I use tmux, I tested tmux invoked with 256 colors or not, running in a panel.
This script can't test the real FPS since Bash script takes some time to process, but the results aren't really much lower and it does show the significant difference between terminals, or those FPS should all be capped around a same number. As you can see, urxvt runs fastest, then xterm, then lxterminal. Though there are some configuration differences, say the fonts, but it's quite conclusive from the numbers I see.
For maximized urxvt+tmux terminal window I normally use in one screen with video played in another screen, here is the result:
For 239x65 100 frames, elapsed time: 18.567 seconds Frames per second: 5.385