Skip to content

runtime: parallel json benchmark leads high CPU usage when go version > 1.15 on ARM64 #60043

@botieking98

Description

@botieking98

I found a problem of CPU performance degradation on ARM64 platform. The parallel json benchmark in the latest go version resulted in a 50%+ increase CPU usage compared to the old version 1.15.

This can be easily reproduced on ARM64:

  1. install golang package
  2. download go-jsonbench: https://github.com/kpango/go-json-bench
  3. cd go-json-bench && make bench and observe CPU usage

My machine configuration:

Architecture:           aarch64
  CPU op-mode(s):       64-bit
  Byte Order:           Little Endian
CPU(s):                 128
  On-line CPU(s) list:  0-127
Vendor ID:              HiSilicon
  BIOS Vendor ID:       HiSilicon
  Model name:           Kunpeng-920
    BIOS Model name:    Kunpeng 920-6426
    Model:              0
    Thread(s) per core: 1
    Core(s) per socket: 64
    Socket(s):          2
    Stepping:           0x1
    Frequency boost:    disabled
    CPU max MHz:        2600.0000
    CPU min MHz:        200.0000
    BogoMIPS:           200.00
    Flags:              fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma dcpop asimddp asimdfhm
Caches (sum of all):
  L1d:                  8 MiB (128 instances)
  L1i:                  8 MiB (128 instances)
  L2:                   64 MiB (128 instances)
  L3:                   128 MiB (4 instances)
NUMA:
  NUMA node(s):         4
  NUMA node0 CPU(s):    0-31
  NUMA node1 CPU(s):    32-63
  NUMA node2 CPU(s):    64-95
  NUMA node3 CPU(s):    96-127

The benchmark result is below:

CPU usage is about 2000% for go 1.15.7:

image

CPU usage is about 3000% for go latest version:

image

Finally, through git bisect search, I found that fe7ff71185cf was the first commit that leads performance degradation, but I was not clear why this commit had such a big impact on CPU performance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions