{"id":1844,"date":"2024-02-29T09:37:59","date_gmt":"2024-02-29T09:37:59","guid":{"rendered":"https:\/\/mvermeulen.org\/perf\/?page_id=1844"},"modified":"2024-03-01T01:44:48","modified_gmt":"2024-03-01T01:44:48","slug":"cachebench","status":"publish","type":"page","link":"https:\/\/mvermeulen.org\/perf\/workloads\/phoronix\/cachebench\/","title":{"rendered":"cachebench"},"content":{"rendered":"\n<p>A test of memory and cache bandwidth. There are three subtests: read, write and read\/modify\/write.  From the profile below these look to be single-threaded and taking similar times.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"960\" src=\"https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/03\/systemtime.png\" alt=\"\" class=\"wp-image-1861\" srcset=\"https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/03\/systemtime.png 1280w, https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/03\/systemtime-1024x768.png 1024w, https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/03\/systemtime-768x576.png 768w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/figure>\n\n\n\n<p>Topdown profile shows the read is memory-bound, write is memory-bound but at lower level and read\/write\/modify has the highest retirement rate.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"960\" src=\"https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/03\/amdtopdown.png\" alt=\"\" class=\"wp-image-1862\" srcset=\"https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/03\/amdtopdown.png 1280w, https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/03\/amdtopdown-1024x768.png 1024w, https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/03\/amdtopdown-768x576.png 768w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/figure>\n\n\n\n<p>AMD metrics show a lot of floating point and relatively low L2 rate.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>elapsed              1178.850\non_cpu               0.060          # 0.96 \/ 16 cores\nutime                1126.046\nstime                0.815\nnvcsw                2097           # 32.65%\nnivcsw               4325           # 67.35%\ninblock              16             # 0.01\/sec\nonblock              12792          # 10.85\/sec\ncpu-clock            1127005636652  # 1127.006 seconds\ntask-clock           1127015577254  # 1127.016 seconds\npage faults          188978         # 167.680\/sec\ncontext switches     12122          # 10.756\/sec\ncpu migrations       292            # 0.259\/sec\nmajor page faults    3              # 0.003\/sec\nminor page faults    188975         # 167.677\/sec\nalignment faults     0              # 0.000\/sec\nemulation faults     0              # 0.000\/sec\nbranches             3634315461911  # 196.499 branches per 1000 inst\nbranch misses        9696274332     # 0.27% branch miss\nconditional          3632170862135  # 196.383 conditional branches per 1000 inst\nindirect             371552984      # 0.020 indirect branches per 1000 inst\ncpu-cycles           5264528460862  # 0.28 GHz\ninstructions         18466319602366 # 3.51 IPC high\nslots                10530906718080 #\nretiring             4944646133622  # 47.0% (47.0%)\n-- ucode             122706597      #     0.0%\n-- fastpath          4944523427025  #    47.0%\nfrontend             1370144825102  # 13.0% (13.0%)\n-- latency           295123694280   #     2.8%\n-- bandwidth         1075021130822  #    10.2%\nbackend              4093208221590  # 38.9% (38.9%)\n-- cpu               3679471645191  #    34.9%\n-- memory            413736576399   #     3.9%\nspeculation          122376475801   #  1.2% ( 1.2%)\n-- branch mispredict 122366430335   #     1.2%\n-- pipeline restart  10045466       #     0.0%\nsmt-contention       530236733      #  0.0% ( 0.0%)\ncpu-cycles           5263576000968  # 0.28 GHz\ninstructions         18472923856823 # 3.51 IPC high\ninstructions         6157833251749  # 6.829 l2 access per 1000 inst\nl2 hit from l1       38763136163    # 0.06% l2 miss\nl2 miss from l1      13623829       #\nl2 hit from l2 pf    3276978159     #\nl3 hit from l2 pf    5015543        #\nl3 miss from l2 pf   5931174        #\ninstructions         6159376479220  # 375.514 float per 1000 inst\nfloat 512            46             # 0.000 AVX-512 per 1000 inst\nfloat 256            610            # 0.000 AVX-256 per 1000 inst\nfloat 128            2312930817690  # 375.514 AVX-128 per 1000 inst\nfloat MMX            0              # 0.000 MMX per 1000 inst\nfloat scalar         0              # 0.000 scalar per 1000 inst\ninstructions         18504565007273 #\nopcache              2049762220432  # 110.771 opcache per 1000 inst\nopcache miss         1017908492     #  0.0% opcache miss rate\nl1 dTLB miss         28190064       # 0.002 L1 dTLB per 1000 inst\nl2 dTLB miss         5684855        # 0.000 L2 dTLB per 1000 inst\ninstructions         18499508052063 #\nicache               2286810824     # 0.124 icache per 1000 inst\nicache miss          211834745      #  9.3% icache miss rate\nl1 iTLB miss         8797810        # 0.000 L1 iTLB per 1000 inst\nl2 iTLB miss         0              # 0.000 L2 iTLB per 1000 inst\ntlb flush            17235          # 0.000 TLB flush per 1000 inst\n<\/code><\/pre>\n\n\n\n<p>Intel metrics break things down by levels of memory hierarchy with the L1 being the highest amount.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>elapsed              1178.774\non_cpu               0.060          # 0.96 \/ 16 cores\nutime                1126.308\nstime                0.563\nnvcsw                2104           # 29.23%\nnivcsw               5094           # 70.77%\ninblock              1136           # 0.96\/sec\nonblock              1504           # 1.28\/sec\ncpu-clock            1126963839893  # 1126.964 seconds\ntask-clock           1126971932472  # 1126.972 seconds\npage faults          184328         # 163.560\/sec\ncontext switches     12897          # 11.444\/sec\ncpu migrations       1050           # 0.932\/sec\nmajor page faults    0              # 0.000\/sec\nminor page faults    184328         # 163.560\/sec\nalignment faults     0              # 0.000\/sec\nemulation faults     0              # 0.000\/sec\nbranches             3606911258653  # 199.754 branches per 1000 inst\nbranch misses        7048723296     # 0.20% branch miss\nconditional          3606911271773  # 199.754 conditional branches per 1000 inst\nindirect             633890851      # 0.035 indirect branches per 1000 inst\nslots                25618559493746 #\nretiring             14217732274034 # 55.5% (55.5%) high\n-- ucode             484349856141   #     1.9%\n-- fastpath          13733382417893 #    53.6%\nfrontend             4621490630497  # 18.0% (18.0%)\n-- latency           881073797992   #     3.4%\n-- bandwidth         3740416832505  #    14.6%\nbackend              6967643203188  # 27.2% (27.2%)\n-- cpu               5626301638829  #    22.0%\n-- memory            1341341564359  #     5.2%\nspeculation          125507624550   #  0.5% ( 0.5%) low\n-- branch mispredict 125315315281   #     0.5%\n-- pipeline restart  192309269      #     0.0%\nsmt-contention       0              #  0.0% ( 0.0%)\ncpu-cycles           4270504875023  # 0.23 GHz\ninstructions         18137358870259 # 4.25 IPC high\nl2 access            59921390459    # 3.304 l2 access per 1000 inst\nl2 miss              207094023      # 0.35% l2 miss\ncpu-cycles           4270576848122  # 11.3% memory latency\nload stalls          430798387441   #  8.3% l1 bound\nl1 miss              76131137261    #  1.8% l2 bound\nl2 miss              433393833      #  0.0% l3 bound\nl3 miss              222225184      #  0.0% dram bound\nstore_stalls         52809562442    #  1.2% store bound\n<\/code><\/pre>\n\n\n\n<p>Process summary shows execution mostly in a cachebench executable.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>370 processes\n\t 18 cachebench            1125.03     0.02\n\t 68 clinfo                  18.19     5.98\n\t 38 vulkaninfo               1.15     1.15\n\t  6 glxinfo:gdrv0            0.16     0.06\n\t  6 glxinfo:gl0              0.16     0.06\n\t  4 vulkani:disk$0           0.13     0.13\n\t  6 php                      0.08     0.19\n\t  2 glxinfo                  0.08     0.02\n\t  2 glxinfo:cs0              0.08     0.02\n\t  2 glxinfo:disk$0           0.08     0.02\n\t  2 glxinfo:sh0              0.08     0.02\n\t  2 glxinfo:shlo0            0.08     0.02\n\t  2 llvmpipe-0               0.07     0.07\n\t  2 llvmpipe-1               0.07     0.07\n\t  2 llvmpipe-2               0.07     0.07\n\t  2 llvmpipe-3               0.07     0.07\n\t  2 llvmpipe-4               0.07     0.07\n\t  2 llvmpipe-5               0.07     0.07\n\t  2 llvmpipe-6               0.07     0.07\n\t  2 llvmpipe-7               0.07     0.07\n\t  2 llvmpipe-8               0.07     0.07\n\t  2 llvmpipe-10              0.06     0.07\n\t  2 llvmpipe-11              0.06     0.07\n\t  2 llvmpipe-12              0.06     0.07\n\t  2 llvmpipe-13              0.06     0.07\n\t  2 llvmpipe-14              0.06     0.07\n\t  2 llvmpipe-15              0.06     0.07\n\t  2 llvmpipe-9               0.06     0.07\n\t  6 clang                    0.06     0.06\n\t  3 rocminfo                 0.03     0.00\n\t  1 lspci                    0.00     0.02\n\t  1 ps                       0.00     0.01\n\t 86 sh                       0.00     0.00\n\t 13 gcc                      0.00     0.00\n\t 10 gsettings                0.00     0.00\n\t  8 stat                     0.00     0.00\n\t  8 systemd-detect-          0.00     0.00\n\t  6 llvm-link                0.00     0.00\n\t  5 gmain                    0.00     0.00\n\t  5 phoronix-test-s          0.00     0.00\n\t  2 cc                       0.00     0.00\n\t  2 lscpu                    0.00     0.00\n\t  2 uname                    0.00     0.00\n\t  2 which                    0.00     0.00\n\t  2 xset                     0.00     0.00\n\t  1 date                     0.00     0.00\n\t  1 dconf worker             0.00     0.00\n\t  1 dirname                  0.00     0.00\n\t  1 dmesg                    0.00     0.00\n\t  1 dmidecode                0.00     0.00\n\t  1 grep                     0.00     0.00\n\t  1 ifconfig                 0.00     0.00\n\t  1 ip                       0.00     0.00\n\t  1 lsmod                    0.00     0.00\n\t  1 mktemp                   0.00     0.00\n\t  1 qdbus                    0.00     0.00\n\t  1 readlink                 0.00     0.00\n\t  1 realpath                 0.00     0.00\n\t  1 sed                      0.00     0.00\n\t  1 sort                     0.00     0.00\n\t  1 stty                     0.00     0.00\n\t  1 systemctl                0.00     0.00\n\t  1 template.sh              0.00     0.00\n\t  1 wc                       0.00     0.00\n\t  1 xrandr                   0.00     0.00\n0 processes running\n47 maximum processes\n<\/code><\/pre>\n\n\n\n<p>Computation blocks are straightforward<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>      7982) cachebench       cpu=14 start=5.68  finish=130.71\n        7983) cachebench       cpu=14 start=5.69  finish=130.71\n      7987) cachebench       cpu=8 start=134.71 finish=259.74\n        7988) cachebench       cpu=1 start=134.72 finish=259.74\n      7990) cachebench       cpu=0 start=263.74 finish=388.77\n        7991) cachebench       cpu=9 start=263.75 finish=388.77\n      7993) sh               cpu=10 start=388.77 finish=388.77\n        7994) sh               cpu=3 start=388.77 finish=388.77\n      7995) cachebench       cpu=3 start=399.06 finish=524.08\n        7996) cachebench       cpu=12 start=399.06 finish=524.08\n      7997) cachebench       cpu=10 start=528.09 finish=653.11\n        7998) cachebench       cpu=3 start=528.09 finish=653.11\n      8002) cachebench       cpu=2 start=657.12 finish=782.14\n        8003) cachebench       cpu=11 start=657.12 finish=782.14\n      8004) sh               cpu=2 start=782.14 finish=782.15\n        8005) sh               cpu=11 start=782.15 finish=782.15\n      8006) cachebench       cpu=2 start=792.33 finish=917.35\n        8007) cachebench       cpu=3 start=792.33 finish=917.35\n      8009) cachebench       cpu=2 start=921.36 finish=1046.38\n        8010) cachebench       cpu=3 start=921.36 finish=1046.38\n      8011) cachebench       cpu=10 start=1050.39 finish=1175.41\n        8012) cachebench       cpu=3 start=1050.39 finish=1175.41\n<\/code><\/pre>\n\n\n\n<p>This is one where breaking out the subtests might show different sets of counter values.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A test of memory and cache bandwidth. There are three subtests: read, write and read\/modify\/write. From the profile below these look to be single-threaded and taking similar times. Topdown profile shows the read is memory-bound, write is memory-bound but at <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/mvermeulen.org\/perf\/workloads\/phoronix\/cachebench\/\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":58,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1844","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/pages\/1844","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/comments?post=1844"}],"version-history":[{"count":2,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/pages\/1844\/revisions"}],"predecessor-version":[{"id":1863,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/pages\/1844\/revisions\/1863"}],"up":[{"embeddable":true,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/pages\/58"}],"wp:attachment":[{"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/media?parent=1844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}