[Bug 1797335] Re: strstr() on ubuntu18.04 8 times slower than on ubuntu16

Paul Stephen Borile paul.borile at gmail.com
Thu Oct 11 09:45:22 UTC 2018


I'm running on amd64, i7 cpu :

$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 60
Model name: Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
Stepping: 3
CPU MHz: 1660.927
CPU max MHz: 3500.0000
CPU min MHz: 800.0000
BogoMIPS: 4988.64
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 6144K
NUMA node0 CPU(s): 0-7
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts flush_l1d

-- 
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/1797335

Title:
  strstr() on ubuntu18.04 8 times slower than on ubuntu16

Status in glibc package in Ubuntu:
  New

Bug description:
  strstr() from glibc is up to 8 times slower than it was on ubuntu16.
  Looks like the sse2 optimized code is not used. To reproduce compile
  attached file (strstr.c) :

  $ gcc -o strstr strstr.c

  and then run on the 2 platforms :

  $ vagrant init ubuntu/bionic64
  $ vagrant up
  $ vagrant ssh
  Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-36-generic x86_64)

   * Documentation:  https://help.ubuntu.com
   * Management:     https://landscape.canonical.com
   * Support:        https://ubuntu.com/advantage

    System information as of Thu Oct 11 09:02:46 UTC 2018

    System load:  0.0              Processes:             97
    Usage of /:   9.8% of 9.63GB   Users logged in:       0
    Memory usage: 12%              IP address for enp0s3: 10.0.2.15
    Swap usage:   0%

   * Security certifications for Ubuntu!
     We now have FIPS, STIG, CC and a CIS Benchmark.

     - http://bit.ly/Security_Certification

   * Want to make a highly secure kiosk, smart display or touchscreen?
     Here's a step-by-step tutorial for a rainy weekend, or a startup.

     - https://bit.ly/secure-kiosk

    Get cloud support with Ubuntu Advantage Cloud Guest:
      http://www.ubuntu.com/business/services/cloud

  0 packages can be updated.
  0 updates are security updates.

  Last login: Thu Oct 11 09:02:17 2018 from 10.0.2.2
  vagrant at ubuntu-bionic:~$ cd /vagrant
  vagrant at ubuntu-bionic:/vagrant$ time ./strstr aa
  matches = 3000000

  real	0m4.877s
  user	0m4.852s
  sys	0m0.012s
  vagrant at ubuntu-bionic:/vagrant$

  Same machine :

  $ vagrant init ubuntu/xenial64
  $ vagrant up
  $ vagrant ssh
  Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-135-generic x86_64)

   * Documentation:  https://help.ubuntu.com
   * Management:     https://landscape.canonical.com
   * Support:        https://ubuntu.com/advantage

    Get cloud support with Ubuntu Advantage Cloud Guest:
      http://www.ubuntu.com/business/services/cloud

  0 packages can be updated.
  0 updates are security updates.

  New release '18.04.1 LTS' available.
  Run 'do-release-upgrade' to upgrade to it.

  Last login: Thu Oct 11 08:22:26 2018 from 10.0.2.2
  vagrant at ubuntu-xenial:~$ cd /vagrant
  vagrant at ubuntu-xenial:/vagrant$ time ./strstr aa
  matches = 3000000

  real	0m0.525s
  user	0m0.508s
  sys	0m0.000s
  vagrant at ubuntu-xenial:/vagrant$
  vagrant at ubuntu-xenial:/vagrant$ time ./strstr aa
  matches = 3000000

  real	0m0.525s
  user	0m0.508s
  sys	0m0.000s
  vagrant at ubuntu-xenial:/vagrant$

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



More information about the foundations-bugs mailing list