Performance Analysis - Powerlevel9k/powerlevel9k GitHub Wiki
This analysis was done on commit 2f4b150 on Fedora 29 inside Gnome Terminal. The data collected is not super scientific per se, but it does provide some good rules of thumb.
More detailed system information is provided below:
OS: Fedora release 29 (Twenty Nine) x86_64
Host: Aspire V5-552P V2.07
Kernel: 4.19.2-300.fc29.x86_64
Shell: zsh 5.6.2
DE: GNOME 3.30.2
Terminal: gnome-terminal
CPU: AMD A10-5757M APU (4) @ 2.500GHz
GPU: AMD ATI Radeon HD 8650G
Memory: 7416 MiB
While adding more and more segments to the ZSH prompt, a noticeable delay between prompts begins to become noticeable. Obviously this cannot be entirely eliminated, but it can be optimized. This analysis seeks to help users in building faster prompts, and also in setting goals for development to optimize more common segments.
A complete spreadsheet with data can be downloaded here, although an (incomplete) summary will be provided here. All values are calculated from "default" scenarios; for example, the delta timings of the SSH segment are calculated from a local machine which is not being SSH'ed into. The goal is to determine how much segments effect common usage, since (in this author's opinion) most people are willing to pay for a small loss in performance when they are active/pertinent. Delta timings are calculated in a simple (but again, not exactly scientific) command: date +%s%N && sleep 1
while pressing UP
+ ENTER
during the 1 second sleep time.
The rankings and delta timings are summarized below for each isolated segment:
Rank | Type | Score |
---|---|---|
1 | Battery | 4.47% |
2 | IP | 3.81% |
3 | Dir | 3.62% |
4 | VCS | 2.06% |
5 | RAM | 2.04% |
6 | Load | 1.97% |
7 | Context | 1.44% |
8 | Time | 1.35% |
9 | Background Jobs | 1.13% |
10 | OS Icon | 0.94% |
11 | Vi Mode | 0.93% |
12 | Command Execution Time | 0.06% |
13 | Dir Writable | -0.03% |
14 | SSH | -0.13% |
Total | 23.67% | |
Bash Baseline (ms) | 9.62065066666662 | |
Baseline (ms) | 69.622016 | |
Increase (ms) | 253.187585230234 | |
Actual Increase (ms) | 300.6417408 | |
Percent Error | 15.78% |
A 15.78% percent error was calculated from combining all segments together in one prompt (rather than individually) during the full experimental test.