@@ -23,20 +23,46 @@ Usage of kube-tmux:
23
23
Separator of Context and Nasespace (default "/")
24
24
```
25
25
26
+ I’m using the follows:
27
+
26
28
``` console
27
29
set -g status-right "#(kube-tmux -separator=':' -ctxFg='colour011#,bright' -ctxBg 'default' -sepFg 'colour015#,bright' -nsFg 'colour075#,bright')"
28
30
```
29
31
30
32
## Benchmark
31
33
34
+ ### Benchmark command:
35
+
36
+ ``` console
37
+ $ kube.tmux
38
+ #[fg=blue]⎈ #[fg=colour]#[fg=]gke_asia-northeast1_cluster#[fg=colour250]:#[fg=]kube-system
39
+
40
+ $ kube-tmux -separator=' :' -ctxFg=' blue' -sepFg ' colour250' -nsFg ' default'
41
+ #[fg=blue]gke_asia-northeast1_cluster#[fg=colour250]:#[fg=default]kube-system#[fg=default#,bg=default]
42
+ ```
43
+
44
+ ### Note
45
+
46
+ - ` go version `
47
+ - ` go version devel go1.17-543e098320 Wed May 5 19:17:46 2021 +0000 X:staticlockranking darwin/amd64 `
48
+ - tmux ` default-shell ` is ` /bin/sh ` .
49
+ - On darwin, ` "echo 3 > /proc/sys/vm/drop_caches" ` similar command is ` "sync && sudo purge" `
50
+
51
+ ### Result
52
+
32
53
``` console
33
- $ hyperfine -S /usr/local/ bin/bash --max-runs 10 --warmup 3 ' kube.tmux'
54
+ $ hyperfine --shell / bin/sh --prepare ' sync && sudo purge ' --max-runs 10 --warmup 3 ' kube.tmux'
34
55
Benchmark #1: kube.tmux
35
- Time (mean ± σ): 109.0 ms ± 2.7 ms [User: 102.7 ms, System: 37.0 ms]
36
- Range (min … max): 106.8 ms … 116.3 ms 10 runs
56
+ Time (mean ± σ): 275.2 ms ± 54.0 ms [User: 111.2 ms, System: 74.3 ms]
57
+ Range (min … max): 224.3 ms … 368.1 ms 10 runs
37
58
38
- $ hyperfine -S /usr/local/ bin/bash --max-runs 10 --warmup 3 " kube-tmux -separator=':' -ctxFg='colour011#,bright ' -ctxBg 'default' - sepFg 'colour015#,bright ' -nsFg 'colour075#,bright '"
39
- Benchmark #1: kube-tmux -separator=':' -ctxFg='colour011#,bright ' -ctxBg 'default' - sepFg 'colour015#,bright ' -nsFg 'colour075#,bright '
40
- Time (mean ± σ): 10.8 ms ± 0 .6 ms [User: 6.7 ms, System: 2.7 ms]
41
- Range (min … max): 10.3 ms … 12.1 ms 10 runs
59
+ $ hyperfine --shell / bin/sh --prepare ' sync && sudo purge ' -- max-runs 10 --warmup 3 " kube-tmux -separator=':' -ctxFg='blue ' -sepFg 'colour250 ' -nsFg 'default '"
60
+ Benchmark #1: kube-tmux -separator=':' -ctxFg='blue ' -sepFg 'colour250 ' -nsFg 'default '
61
+ Time (mean ± σ): 102.2 ms ± 64 .6 ms [User: 8.0 ms, System: 35.6 ms]
62
+ Range (min … max): 12.5 ms … 178.0 ms 10 runs
42
63
```
64
+
65
+ | Command | Mean [ ms] | Min [ ms] | Max [ ms] | Relative |
66
+ | :----------------------------------------------------------------------------| -------------:| ---------:| ---------:| ---------:|
67
+ | ` kube.tmux ` | 290.2 ± 62.9 | 223.6 | 382.2 | 1.00 |
68
+ | ` kube-tmux -separator=':' -ctxFg='blue' -sepFg 'colour250' -nsFg 'default' ` | 84.2 ± 59.6 | 15.9 | 156.5 | 1.00 |
0 commit comments