What language / platform would you recommend for a processor-bound application?

I am developing a non-interactive cpu-bound application that only performs calculations, with almost no I / O. It has been working for too long at the moment, and while I am working on improving the algorithm, I also think that it can bring any benefit for changing the language or platform. This is currently C ++ (without OOP, so it's almost C) on Windows compiled with the Intel C ++ compiler. Can I switch to ASM help and how much? Can I switch to Linux and GCC?

+5
source share
22 answers

Just to be thorough: the first thing to do is collect the profile data, and the second is to consider your algorithms. I am sure you know this, but they should be included in any discussion of performance.

Directly about your question "Can you switch to ASM help?" answer: "If you do not know the answer to this question, then probably not." If you are not familiar with the processor architecture and its functions, it is unlikely that you will do much better work than a good optimizing C / C ++ compiler for your code.

, ( ) parallelism, . 4 8 , , . C/++, OpenMP ; (, , " parallelism, " ).

, C/++. Intel ++ OpenMP, , Threading Building.

, , ++, " , / parallelism ". "" , , , , , , .

+15

, . : " ".

.

. , . "" - , -. . , - .

+14

ASM , / , , . , / .. - .

:

  • / .
  • / , ,

++ , . /, , .

+6

asm , Intel ++, , , , :

  • , , , VectorC .
  • asm MMX, 3DNow!, SSE - ( ). , asm.
  • GPGPU, .. CPU. .

: . AQTime, Intel ++.

+4

, parallelism, . ( !) , .

, , , OpenMP C/++. ( , , Java/.NET, , !)

+3

Fortran 77 - , . , OpenMP .

+3

, ASM , ++ , .

-, , , SOL, , .

, , , - , .., . ( C ) , , . , , "" , ENORMOUS. 2X , .

, , .

+3

, , , ASM-... , , , " ".

?

, - ?

?

- , , O (1)? O (1)? , ?

, , ? (, , ) , ..? , , ( , )

.

, , , : ", , , ?" .

! , .

+2

, , ..

, , , , . , ALU (-). , :

// Assume N is a big number
for (int i=0; i<N; i++) {
  myArray[i] = dosomething(i);
}
for (int i=0; i<N; i++) {
  myArray[i] = somethingElse(myArray[i]);
}
...

:

for (int i=0; i<N; i++) {
  double tmp = dosomething(i);
  tmp = somethingElse(tmp);
  ...
  myArray[i] = tmp;
}
...

2x.

+1

Oregonghost - VectorC. , , mmx sse. , , 150% -200%.

+1
0

, , . .

, LINPACK LAPACK 10 / LU BLAS.

0

++ Intel, ( ). , V++ , , gcc. parallelism. MMX, SSE SSE2 . , , , .

0

, , , . , , , , . , - ? , Assembler , ( , re).

0

ASM . , SSE .

, Intel ++ g++ ( 15% ), Mac OS X, Windows Linux.

. " ", , .

, , ( kcachegrind valgrind Linux, Shark Mac OS X. , , ).

, , , - 95% , . , - 1% , .

0

2 "CPU-bound": 1. CPU (core) s 2. - .

2 1 , 50%. , ++ ASM 5% ( ASM -5%!). 8 16 . - , , .

. - Windows = x86/x64, SSE. . , .

0

. , , , ASM, . , , ASM, , , , , .

0
0
0

Linux

Linux , , .

0

CrowdProcess 2000 , . API , , . Javascript, , ++ ASM.

, ++ ASM, , , , CrowdProcess .

: CrowdProcess.

0

ASM, , C ++. , , , , , 10% - , .

, . , , .

-1

All Articles