fbpx

Expresate

Si además quieres enviarnos un Artículo para el Blog y redes sociales, pulsa el siguiente botón:

Avisos
Vaciar todo

Procesador de Intel I5 extremadamente lento. AYUDA

2 Respuestas
2 Usuarios
0 Reactions
10 K Visitas
fusion
Respuestas: 391
Topic starter
(@fusion)
Ardero
Registrado: hace 17 años

PORFAVOR, si alguno puede pasar el test a un RYZEN 7 lo agradecería!!

Resulta que tarda mucho en hacer divisiones.
Lo he probado en mi nuevo ordenador I5 y tampoco supera los 21 Mops!

Resultados:
=== Dual-Core AMD Opteron(tm) Processor 2220 1-2.8Ghz

======================================================================

Time for 100 Mega double divisions time = 10.1054 = 10.3764 MOPs

Time for 100 Mega float divisions time = 9.714 = 10.7945 MOPs

Time for 100 Mega double multiplications time = 0.641829 = 163.373 MOPs

Time for 100 Mega double sums time = 0.657963 = 159.367 MOPs

Time for 100 Mega double sqrt time = 1.74466 = 60.102 MOPs

Time for 100 Mega double sin time = 2.43805 = 43.0087 MOPs

Time for 100 Mega double log time = 1.3058 = 80.3017 MOPs

Time for 100 Mega int sums time = 0.356066 = 294.489 MOPs

Time for 100 Mega int << time = 0.343526 = 305.239 MOPs

Time for 100 Mega int divisions time = 1.76286 = 59.4814 MOPs

Time for 100 Mega int multiplications time = 0.354854 = 295.495 MOPs

Time for 100 Mega int sum+mult time = 0.364358 = 287.787 MOPs

======================================================================

=== E5-1620 v3 3.5Ghz ================================================
======================================================================
Time for 100 Mega double divisions time = 5.242 = 20.0034 MOPs
Time for 100 Mega double divisions (20x) time = 0.399 = 262.801 MOPs
Time for 100 Mega float divisions time = 4.676 = 22.4246 MOPs
Time for 100 Mega double multiplications time = 0.153 = 685.344 MOPs
Time for 100 Mega double sums time = 0.101 = 1038.19 MOPs
Time for 100 Mega double sqrt time = 0.693 = 151.31 MOPs
Time for 100 Mega double sin time = 7.008 = 14.9626 MOPs
Time for 100 Mega double log time = 8.358 = 12.5458 MOPs
Time for 100 Mega int sums time = 0.026 = 4032.98 MOPs
Time for 100 Mega int << time = 0.056 = 1872.46 MOPs
Time for 100 Mega int divisions time = 0.743 = 141.127 MOPs
Time for 100 Mega int multiplications time = 0.109 = 961.996 MOPs
Time for 100 Mega int sum+mult time = 0.06 = 1747.63 MOPs
======================================================================

======================================================================
Time for 100 Mega double divisions time = 5.199 = 20.1688 MOPs
Time for 100 Mega double divisions (20x) time = 0.706 = 148.524 MOPs
Time for 100 Mega float divisions time = 4.621 = 22.6915 MOPs
Time for 100 Mega double multiplications time = 0.154 = 680.894 MOPs
Time for 100 Mega double sums time = 0.103 = 1018.03 MOPs
Time for 100 Mega double sqrt time = 0.684 = 153.301 MOPs
Time for 100 Mega double sin time = 8.202 = 12.7844 MOPs
Time for 100 Mega double log time = 14.608 = 7.17809 MOPs
Time for 100 Mega int sums time = 0.032 = 3276.8 MOPs
Time for 100 Mega int << time = 0.056 = 1872.46 MOPs
Time for 100 Mega int divisions time = 0.807 = 129.935 MOPs
Time for 100 Mega int multiplications time = 0.097 = 1081.01 MOPs
Time for 100 Mega int sum+mult time = 0.036 = 2912.71 MOPs
======================================================================

=== I7-Q720 1.6GHz ================================================
======================================================================
Time for 100 Mega double divisions time = 10.9031 = 9.6172 MOPs
Time for 100 Mega double divisions (20x) time = 1.14586 = 91.5102 MOPs
Time for 100 Mega float divisions time = 11.2313 = 9.33619 MOPs
Time for 100 Mega double multiplications time = 0.595324 = 176.135 MOPs
Time for 100 Mega double sums time = 0.483892 = 216.696 MOPs
Time for 100 Mega double sqrt time = 1.4338 = 73.1324 MOPs
Time for 100 Mega double sin time = 2.27436 = 46.1043 MOPs
Time for 100 Mega double log time = 1.59232 = 65.852 MOPs
Time for 100 Mega int sums time = 0.324371 = 323.264 MOPs
Time for 100 Mega int << time = 0.337373 = 310.806 MOPs
Time for 100 Mega int divisions time = 1.07184 = 97.8293 MOPs
Time for 100 Mega int multiplications time = 0.390291 = 268.665 MOPs
Time for 100 Mega int sum+mult time = 0.363438 = 288.516 MOPs
======================================================================
======================================================================

A ver si podeis hacer correr el codigo de abajo en un Ryzen 7!!!
Compuila bien en linux y windows.
#include <iostream>
#include <string.h> //strcpy strcat
#include <stdio.h> //fopen
#include <math.h> //sqrt, sin
#include <time.h> //clock(), time_t
#pragma warning(disable:4996) //disable deprecateds
using namespace std;

#define _PRINT_RESULT

time_t start,stop;char null_char='';
//Use empty timer() to reset start time:
#ifndef _PRINT_RESULT
void timer(char *title=&null_char,int data_size=1){ stop=clock(); if (*title) printf("%s time = %7lg = %7lg MOPsn",title,(double) (stop-start)/(double) CLOCKS_PER_SEC, 1e-6*data_size/( (double)(stop-start)/(double)CLOCKS_PER_SEC ) ); start=clock(); }
#else
char string_timer[128*1024],str1[1024];
void timer(char *title=&null_char,int data_size=1)
{
stop=clock();
if (*title)
{
sprintf(str1,"%s time = %7lg = %7lg MOPsn",title,(double) (stop-start)/(double) CLOCKS_PER_SEC, 1e-6*data_size/( (double)(stop-start)/(double)CLOCKS_PER_SEC ) );
cout<<str1; strcat(string_timer,str1);
}
start=clock();
}
#endif

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!
double dsum=1.0,d2=1.111;
// for (int i=0;i<size/20;i++)
// dsum=2.0/(dsum+3.0/(dsum+4.0/(dsum+5.0/(dsum+6.0/(dsum+7.0/(dsum+8.0/(dsum+9.0/(dsum+10.0/(dsum+11.0/(dsum +12.0/(dsum+13.0/(dsum+14.0/(dsum+15.0/(dsum+16.0/(dsum+17.0/(dsum+18.0/(dsum+19.0/(dsum+21.0/(dsum+27.0/(dsum+2.0 ;
// timer("Time for 100 Mega double divisions x20 ",size);
for (int i=0;i<size;i++)
dsum/=d2;
timer("Time for 100 Mega double divisions ",size);
for (int i=0;i<size/20;i++)
{
dsum=1.1/(dsum+2.2/(dsum+2.3/(dsum+2.4/(dsum+2.5/(dsum+2.6/(dsum+2.7/(dsum+2.8/(dsum+2.9/(dsum+2.1/(dsum+2.2/(dsum+2.3/(dsum+2.4/(dsum+2.5/(dsum+2.6/(dsum+2.7/(dsum+2.8/(dsum+2.9/(dsum+3.1/(dsum+1.111)))))))))))))))))));
}
timer("Time for 100 Mega double divisions (20x)",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 double sums ",size);
for (int i=0;i<size;i++)
dsum=sqrt(dsum);
timer("Time for 100 Mega double sqrt ",size);dsum+=1.01;
for (int i=0;i<size;i++)
dsum=sin(dsum);
timer("Time for 100 Mega double sin ",size);dsum+=1.01;
for (int i=0;i<size;i++)
dsum=log(dsum+2.0);
timer("Time for 100 Mega double log ",size);dsum+=1.01;
for (int i=0;i<size;i++)
isum+=i;
timer("Time for 100 Mega int sums ",size);
for (int i=0;i<size;i++)
isum<<=i;
timer("Time for 100 Mega int << ",size);
isum+=1;
for (int i=1;i<size+1;i++)
isum/=i;
timer("Time for 100 Mega int divisions ",size);
for (int i=1;i<size+1;i++)
isum*=i;
timer("Time for 100 Mega int multiplications ",size);
for (int i=1;i<size+1;i++)
isum=isum*2+i;
timer("Time for 100 Mega int sum+mult ",size);

#ifdef _PRINT_RESULT
FILE *str=fopen("timer result.txt","a");
fprintf(str,"n======================================================================n");
fprintf(str,"%s",string_timer);
fprintf(str, "======================================================================n");
fclose(str);
#endif

cout<<endl<<" Reject following data (done to force for loops be performed after compiler optimizations): ";
cout<<isum<<dsum<<fsum<<endl;//to force for() be done on isum
cout<<"=== FIN ==="<<endl;getchar();
return 1;
}

Responder
1 respuesta
ranganok
Respuestas: 3875
(@ranganok)
Ardero
Registrado: hace 19 años

Estas haciendo una ejecución lineal en un procesador multithread. Si quieres más velocidad has todas las operaciones en paralelo.

S2

Ranganok Schahzaman

Responder
Compartir: