1 Reply Latest reply on Sep 30, 2017 4:08 PM by JBtech

    New Intel I5&E5 removed floating point divisions making them extremely slow

    jlopez2022

      Does new Ryzen 7 has still floatin point alus?

       

      This was the result of my test on a new E5 processor under win10 with a Intel xeon CPU E5-1620 v3 @3.5Ghz obtaining simitar results than raspberry pi performance. My bear grew waiting.

       

      I obtained:

       

      integer sums: 2184 Mops (megaoperations/second) as expected

      double divisions: 15.6 - 18.32 Mops   !!!!!!!!!!!!!!!

      float divisions: 17.3 - 19.1 Mops       not 1700 but 17 only!!!!

      double multiplications: 344 -430 Mops

      double sums: 881 - 1178 Mops

       

      I tested also on a I5 and divisions where slower than 21 MOPs.

       

      Please test it in a Ryzen 7.

       

      This is the C++ test:

       

      #include <iostream>

      #include <time.h> //clock(), time_t

      #pragma warning(disable:4996) //disable deprecateds
      using namespace std;

       

       

      time_t start,stop;char null_char='\0';

      //Use empty timer() to reset start time:

      void timer(char *title=&null_char,int data_size=1){ stop=clock(); if (*title) cout<<title<< " time ="<<(double) (stop-start)/(double) CLOCKS_PER_SEC<< " = " << 1e-6*data_size/( (double)(stop-start)/(double)CLOCKS_PER_SEC ) <<  " Mops/seg"  <<endl; start=clock(); }

       

       

      int main()

      {

      cout << "Perform test in Release mode. Results will be wrong in debug mode" <<endl;

      int isum=0,size=100*1024*1024;

      timer();//void timer resets timer!

      for (int i=0;i<size;i++)

      isum+=i;

      timer("Time for 100 Mega int sums ",size);

      double dsum=1.0;

      for (int i=0;i<size;i++)

      dsum=dsum/1.1111;

      timer("Time for 100 Mega double divisions",size);double d2=1.111;dsum+=0.1;

      for (int i=0;i<size;i++)

      dsum/=d2;

      timer("Time for 100 Mega double divisions-2",size);

      float fsum=1.0f;

      for (int i=0;i<size;i++)

      fsum=fsum/1.1111f;

      timer("Time for 100 Mega float divisions",size);

      for (int i=0;i<size;i++)

      dsum=dsum*d2;

      timer("Time for 100 Mega double multiplications",size);

      for (int i=0;i<size;i++)

      dsum=dsum+d2;

      timer("Time for 100 Mega sums multiplications",size);

       

      cout<<endl<<" Reject following line data (done to force for loops be performed after compiler optimizations):"<<endl;;

      cout<<isum<<dsum<<fsum<<endl;//to force for() be done on isum

      cout<<"=== FIN ==="<<endl;getchar();

      return 1;

      }

        • Re: New Intel I5&E5 removed floating point divisions making them extremely slow
          JBtech

          I ran it using VS 2017 Ver. 15.3.5 (Ryzen 1700) @ 3.95 GHz. 32GB Ram DR using a release mode build. OS: Windows 8.1 Pro

           

          I am not sure how it compares with other processors but I could try running it on a few Intel CPU's I have around core i5 through i7's.

           

          Perform test in Release mode. Results will be wrong in debug mode

          Time for 100 Mega int sums  time =0.018 = 5825.42 Mops/seg

          Time for 100 Mega double divisions time =0.506 = 207.228 Mops/seg

          Time for 100 Mega double divisions-2 time =0.507 = 206.82 Mops/seg

          Time for 100 Mega float divisions time =0.414 = 253.279 Mops/seg

          Time for 100 Mega double multiplications time =0.108 = 970.904 Mops/seg

          Time for 100 Mega sums multiplications time =0.081 = 1294.54 Mops/seg

           

           

          Reject following line data (done to force for loops be performed after compiler

          optimizations):

          -52428800inf7.00649e-45

          === FIN ===