今天和朋友闲聊,提到他如何操作一台刚配好的台机。他本人对 Windows 的 shell 环境极为不满,先是折腾了两天的黑苹果未果,又重新改装 Windows 在虚拟机里装了 Linux ,这个过程仍然念念不忘喷 Windows 垃圾。随后我跟他讨论到底应该怎么样才能做到在机器上跑一个终端“其终端要漂亮 功能要丰富”。我说,你直接 Mac 用 ssh 连虚拟机里的 Linux 用不就行了吗?他良久无语…想想好像是这样,随后感慨为何这么蠢…

晚上闲下来之后,我想起自己的神船上有挺久以前装的 Vmware ,干脆拿来也这么整了一遭,给虚拟机分配了8个核心(这里我不清楚应该按照母机的物理核心4核来分配,还是应该算上了超线程技术的8核心来分配,姑且先分配了8核)。然后用Unixbench测了测性能,跑分结果如下:

---------------------------------------------------------------------
Benchmark Run: Mon Oct 31 2016 10:04:18 - 10:32:32
8 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables 36709669.1 lps (10.0 s, 7 samples)
Double-Precision Whetstone 2696.6 MWIPS (9.9 s, 7 samples)
Execl Throughput 2083.9 lps (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 1280512.5 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 361312.4 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 2454520.0 KBps (30.0 s, 2 samples)
Pipe Throughput 2661895.1 lps (10.0 s, 7 samples)
Pipe-based Context Switching 30884.3 lps (10.0 s, 7 samples)
Process Creation 6813.4 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 9503.3 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 3944.9 lpm (60.0 s, 2 samples)
System Call Overhead 4198023.4 lps (10.0 s, 7 samples)

System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 36709669.1 3145.6
Double-Precision Whetstone 55.0 2696.6 490.3
Execl Throughput 43.0 2083.9 484.6
File Copy 1024 bufsize 2000 maxblocks 3960.0 1280512.5 3233.6
File Copy 256 bufsize 500 maxblocks 1655.0 361312.4 2183.2
File Copy 4096 bufsize 8000 maxblocks 5800.0 2454520.0 4231.9
Pipe Throughput 12440.0 2661895.1 2139.8
Pipe-based Context Switching 4000.0 30884.3 77.2
Process Creation 126.0 6813.4 540.7
Shell Scripts (1 concurrent) 42.4 9503.3 2241.3
Shell Scripts (8 concurrent) 6.0 3944.9 6574.8
System Call Overhead 15000.0 4198023.4 2798.7
 ========
System Benchmarks Index Score 1444.1

---------------------------------------------------------------------
Benchmark Run: Mon Oct 31 2016 10:32:32 - 11:00:27
8 CPUs in system; running 8 parallel copies of tests

Dhrystone 2 using register variables 156209553.8 lps (10.0 s, 7 samples)
Double-Precision Whetstone 18267.1 MWIPS (9.9 s, 7 samples)
Execl Throughput 20028.6 lps (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 1118639.4 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 307208.7 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 2768817.2 KBps (30.0 s, 2 samples)
Pipe Throughput 9990734.4 lps (10.0 s, 7 samples)
Pipe-based Context Switching 1564748.1 lps (10.0 s, 7 samples)
Process Creation 48640.6 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 38393.3 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 4943.3 lpm (60.1 s, 2 samples)
System Call Overhead 8248780.7 lps (10.0 s, 7 samples)

System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 156209553.8 13385.6
Double-Precision Whetstone 55.0 18267.1 3321.3
Execl Throughput 43.0 20028.6 4657.8
File Copy 1024 bufsize 2000 maxblocks 3960.0 1118639.4 2824.8
File Copy 256 bufsize 500 maxblocks 1655.0 307208.7 1856.2
File Copy 4096 bufsize 8000 maxblocks 5800.0 2768817.2 4773.8
Pipe Throughput 12440.0 9990734.4 8031.1
Pipe-based Context Switching 4000.0 1564748.1 3911.9
Process Creation 126.0 48640.6 3860.4
Shell Scripts (1 concurrent) 42.4 38393.3 9055.0
Shell Scripts (8 concurrent) 6.0 4943.3 8238.8
System Call Overhead 15000.0 8248780.7 5499.2
 ========
System Benchmarks Index Score 5022.9

======= Script description and score comparison completed! =======
这是调整为4Core的情况,看得出不管是整体性能还是单核性能相较于8Core都有所下降:
------------------------------------------------------------------------
Benchmark Run: Tue Nov 01 2016 05:15:57 - 05:44:15
4 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       35798003.0 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     2602.6 MWIPS (9.9 s, 7 samples)
Execl Throughput                               2520.9 lps   (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks       1156077.6 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          353214.5 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       2007012.8 KBps  (30.0 s, 2 samples)
Pipe Throughput                             2588626.0 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                  29303.0 lps   (10.0 s, 7 samples)
Process Creation                               6573.4 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   9485.0 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                   3283.0 lpm   (60.0 s, 2 samples)
System Call Overhead                        4141853.2 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   35798003.0   3067.5
Double-Precision Whetstone                       55.0       2602.6    473.2
Execl Throughput                                 43.0       2520.9    586.3
File Copy 1024 bufsize 2000 maxblocks          3960.0    1156077.6   2919.4
File Copy 256 bufsize 500 maxblocks            1655.0     353214.5   2134.2
File Copy 4096 bufsize 8000 maxblocks          5800.0    2007012.8   3460.4
Pipe Throughput                               12440.0    2588626.0   2080.9
Pipe-based Context Switching                   4000.0      29303.0     73.3
Process Creation                                126.0       6573.4    521.7
Shell Scripts (1 concurrent)                     42.4       9485.0   2237.0
Shell Scripts (8 concurrent)                      6.0       3283.0   5471.6
System Call Overhead                          15000.0    4141853.2   2761.2
                                                                   ========
System Benchmarks Index Score                                        1383.8

------------------------------------------------------------------------
Benchmark Run: Tue Nov 01 2016 05:44:15 - 06:12:33
4 CPUs in system; running 4 parallel copies of tests

Dhrystone 2 using register variables      125395491.8 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                    10174.8 MWIPS (10.0 s, 7 samples)
Execl Throughput                              16799.4 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks       1326749.6 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          369326.5 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       2735863.0 KBps  (30.0 s, 2 samples)
Pipe Throughput                             9106903.3 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                1328916.6 lps   (10.0 s, 7 samples)
Process Creation                              41494.8 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                  31921.9 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                   3878.5 lpm   (60.0 s, 2 samples)
System Call Overhead                        9488815.2 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0  125395491.8  10745.1
Double-Precision Whetstone                       55.0      10174.8   1850.0
Execl Throughput                                 43.0      16799.4   3906.8
File Copy 1024 bufsize 2000 maxblocks          3960.0    1326749.6   3350.4
File Copy 256 bufsize 500 maxblocks            1655.0     369326.5   2231.6
File Copy 4096 bufsize 8000 maxblocks          5800.0    2735863.0   4717.0
Pipe Throughput                               12440.0    9106903.3   7320.7
Pipe-based Context Switching                   4000.0    1328916.6   3322.3
Process Creation                                126.0      41494.8   3293.2
Shell Scripts (1 concurrent)                     42.4      31921.9   7528.7
Shell Scripts (8 concurrent)                      6.0       3878.5   6464.2
System Call Overhead                          15000.0    9488815.2   6325.9
                                                                   ========
System Benchmarks Index Score                                        4492.2

======= Script description and score comparison completed! =======