MATLAB vs Python Computational Speed

Windows Edition
Windows 8.1 Pro

System
Processor Intel(R) Core(TM) i7-5500U CPU @ 2.4GHz
Installed Memory 8.00 GB
System Type 64 Bit Operating System, x64 Based Processor

Integrated Development Environment (IDE)
Enthought Canopy
Version 2.1.3.3542 (32 bit)

Operation Time in sec (MATLAB) Time in sec (PYTHON)
10 million uniform random variable generation 0.10 0.15
10 million normal random variable generation 0.13 0.40
for loop counting up to 100 million 0.40 11.60
Comparing two vectors of length 10 million each 0.39 0.55
Plotting a histogram of 10 million values 0.89 0.76
Plotting a scatter plot of 1 million values 0.30 0.23
Bit error rate calculation of BPSK for 10 values of SNR 2.49 4.51

Although Python is a bit slower than MATLAB for most of the cases but the real difference is in implementation of “for loop” where the speed of MATLAB is 29x that of Python. Another surprising result was that the plot functions for Python were somewhat faster than MATLAB.

Author: Yasir Ahmed (aka John)

More than 20 years of experience in various organizations in Pakistan, the USA, and Europe. Worked as a Research Assistant within the Mobile and Portable Radio Group (MPRG) of Virginia Tech and was one of the first researchers to propose Space Time Block Codes for eight transmit antennas. The collaboration with MPRG continued even after graduating with an MSEE degree and has resulted in 12 research publications and a book on Wireless Communications. Worked for Qualcomm USA as an Engineer with the key role of performance and conformance testing of UMTS modems. Qualcomm is the inventor of CDMA technology and owns patents critical to the 4G and 5G standards.

0.00 avg. rating (0% score) - 0 votes

Leave a Reply

Your email address will not be published. Required fields are marked *