Math library function sqrt() is 10x slower in Ubuntu 14.04 compared to Ubuntu 12.04

Bug #1415174 reported by Mahesh Radhakrishnan on 2015-01-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Marcola project
Undecided
Manoj Iyer

Bug Description

The function sqrt() which is a part of the gnu math library, 'libm' is 10x slower in Ubuntu 14.04 than in Ubuntu 12.04

Attached is a stand alone program which uses the sqrt() function from the libm library, and measures the time taken over 1 million times of invoking sqrt() of a random 'double' number.

The output of the program,when compiled and run in Ubuntu 12.04 is as below

 SQRT(1804289383.000000), over a iteration of 1000000, total time taken = 0.030030 seconds

The output of the same program, compiled and run on 14.04 is as below

SQRT(1804289383.000000), over a iteration of 1000000, total time taken = 0.424501 seconds

As you can see, for the same input value, the performance of sqrt() on Ubuntu 14.04 is > 10x smaller than that of 12.04.

Steps to reproduce:
 Compile the attached file sqrt_example.c
    gcc -o sqrt_example sqrt_example.c -lm -lrt
Run the binary.
   ./sqrt_example
Sample Output
SQRT(1804289383.000000), over a iteration of 1000000, total time taken = 0.424501 seconds

information type: Proprietary → Public
Changed in marcola:
assignee: nobody → Manoj Iyer (manjo)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments