[Bug 1988240] [NEW] Performance regression with memcpy on Intel CPU

Shantanu Jain 1988240 at bugs.launchpad.net
Wed Aug 31 03:18:15 UTC 2022


Public bug reported:

# lsb_release -rd
Description:	Ubuntu 20.04.4 LTS
Release:	20.04

Reporting a performance regression in libc6-dev==2.31-0ubuntu9.9 when
upgrading from 9.7.

Regression was observed on Intel Xeon(R) Gold 6248 CPU @ 2.50GHz
(Cascade Lake)

We're seeing a 3x slowdown on e.g. the following tiny program and similar slowdowns on important workloads:
```
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

int main(void) {
    size_t SIZE = (1 << 20);
    char *src = malloc(SIZE);
    char *dst = malloc(SIZE);

    for(int i = 0; i < (SIZE); ++i) {
        src[i] = rand() % 256;
        dst[i] = rand() % 256;
    }
    clock_t start = clock();
    for(int i = 0; i < 10000; ++i) {
        memcpy(dst, src, SIZE);
    }
    clock_t end = clock();
    printf("%f\n", (double) (end - start)/CLOCKS_PER_SEC);
}
```

Probably due to changes resulting from
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1928508

** Affects: glibc (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/1988240

Title:
  Performance regression with memcpy on Intel CPU

Status in glibc package in Ubuntu:
  New

Bug description:
  # lsb_release -rd
  Description:	Ubuntu 20.04.4 LTS
  Release:	20.04

  Reporting a performance regression in libc6-dev==2.31-0ubuntu9.9 when
  upgrading from 9.7.

  Regression was observed on Intel Xeon(R) Gold 6248 CPU @ 2.50GHz
  (Cascade Lake)

  We're seeing a 3x slowdown on e.g. the following tiny program and similar slowdowns on important workloads:
  ```
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  #include <time.h>

  int main(void) {
      size_t SIZE = (1 << 20);
      char *src = malloc(SIZE);
      char *dst = malloc(SIZE);

      for(int i = 0; i < (SIZE); ++i) {
          src[i] = rand() % 256;
          dst[i] = rand() % 256;
      }
      clock_t start = clock();
      for(int i = 0; i < 10000; ++i) {
          memcpy(dst, src, SIZE);
      }
      clock_t end = clock();
      printf("%f\n", (double) (end - start)/CLOCKS_PER_SEC);
  }
  ```

  Probably due to changes resulting from
  https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1928508

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1988240/+subscriptions




More information about the foundations-bugs mailing list