+ 11
The fastest programming language
hi dear friends i should write a very big code for my master thesis the most important factor in my code is run time this code should calculate many mathematic problems that is based on matrix calculation and is very huge (for FEM in engineering ) please help me which one of programming language is the fastest for my problem and i can decrease run time in it(compared with other language)
42 Réponses
+ 8
C ànd C++👍
+ 6
Use python numpy library, or tensorflow. They are written on C, and good optimized for matrix calculation.
+ 5
If runtime speed is important, C or C++ is a good candidate.
The performance will also depend on the compiler.
Now, maybe you can be clever about it, and write only the bit that needs to be fast in C, and create a library that you can call from a larger wrapper program written in another language, such as python.
Also, I am assuming that it is up to you to write the fast code.
if this is not the case, and you are only interested in the outcome of number crunching, you may want to look for existing math libraries that you could reuse.
See the following link for some more considerations
https://stackoverflow.com/questions/6955114/is-c-notably-faster-than-c
+ 4
how is c++???
assembly is very hard because in next step i should change my code for parallel computation and i thank working with assembly is very hard in this step
is it true??
+ 4
I recommend c++ for efficiency || Python for simplicity
+ 4
C!
+ 4
assembly, C++ or maybe Fortran. C++ is C with additional optional features. And these days, C++ compilers produce often faster code than C compilers. Never touched Fortran, so I don't know if it's better.
But don't do the performance critical work in Python.
+ 3
if you need to do numeric work you should also consider fortran (depending on your field of course) since there are large very optimized codebases of numeric code in fortran going back as far as the 50s. the other candidate would be C/C++ and you should probably prefer it if there is no specific code in fortran you need to use in your work that doesn‘t have c/c++ bindings available.
look into the intel compilers if your code is running on a x86 related platform they are known for producing fast numeric code
http://moreisdifferent.com/2015/07/16/why-physicsts-still-use-fortran/
matrix libraries you should look into:
Blitz++
LAPACK
+ 3
C++ for speed.
+ 3
If you would work with many complex arithmatic formulas and it's very massive to solve them 'mathlab' has many powerful functions to solve them simply but if you want to do it quikly first "python " and and second "C++" will helpful for you.
good luck!
+ 3
Some big companies use python, with C++ in the areas where memory management or additional performance is required :
https://realpython.com/world-class-companies-using-python/
+ 3
Well yes, if your research is about creating algorithms, C/C++ is the way forward (I don't know fortran, so can't comment)
It may be part of your research to compare the speed of your code with what you can get from numpy or other existing solutions !
😁
+ 3
Whatever you do, the choice of compiler and underlying math libraries is also important.
For example, Intel has good resources, optimized for their processors.
+ 2
Don't knowing this time.....
+ 2
C & C++
+ 2
Ehsan Fakharzadeh python numpy will not be faster, for huge matrix stuff fortran with lapack is probably best