Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7744377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:45:10+00:00 2026-06-01T09:45:10+00:00

I tried profiling the EIG function on MATLAB and NumPy to compare performance on

  • 0

I tried profiling the EIG function on MATLAB and NumPy to compare performance on my Macbook Pro (2 GHz, Quad core i7 running OS X 10.6). NumPy EIG appears to be quite slow compared to MATLAB.

Here’s the code I profiled on NumPy:

s = '''\
x = numpy.random.random((2000,2000));
numpy.linalg.eig(x);
'''
t = timeit.Timer(stmt=s,setup="import numpy")
result = t.repeat(repeat=5,number=10)
result
Out[22]: 
[197.1737039089203,
 197.34872913360596,
 196.8160741329193,
 197.94081807136536,
 194.5740351676941]

That’s around 19.5 secs/exec in NumPy.

Here’s the same code in MATLAB:

clear all
tic;
for i = 1:50
    x = rand(2000,2000);
    eig(x);
end
toc;
Elapsed time is 267.976645 seconds.

That’s around 5.36 secs/exec on MATLAB.

I guess something as simple as this should not depend much on JIT performance, so it probably boils down to BLAS and the routines that access the BLAS libraries. I know that MATLAB uses the Accelerate Framework on the Mac.

NumPy also appears to use the Accelerate Framework BLAS on my Macbook Pro; here’s the output of numpy.show_config()

numpy.show_config()
lapack_opt_info:
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    extra_compile_args = ['-msse3']
    define_macros = [('NO_ATLAS_INFO', 3)]
blas_opt_info:
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
    define_macros = [('NO_ATLAS_INFO', 3)]

I’m using Python 2.7.2 and NumPy 1.6 (both installed from MacPorts)

So here’s my question to the NumPy folks:
Why is NumPy slower in this instance? Have I left out some optimization while installing NumPy?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:45:11+00:00Added an answer on June 1, 2026 at 9:45 am

    As far as I know, the MATLAB uses MKL libraries as BLAS, not the Accelerate Framework.
    My experience tells me, that Accelerate is significantly slower than MKL.
    To check it, you can try to get the academic version of the Enthought Python Distribution (EPD), where Numpy is compiled against MKL, and compare these timings.
    Moreover, by default, MATLAB uses all the threads (try running in single-threaded mode),
    but Numpy is not.
    In the EPD, it can be done with running

    import mkl 
    mkl.set_num_threads(4) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Tried this: $('.link').click(function(e) { $.getScript('http://www.google.com/uds/api?file=uds.js&amp;v=1.0', function() { $('body').append('<p>GOOGLE API (UDS) is loaded</p>'); }); return
I am interested in profiling a module for the Linux Kernel. I tried it
I heard and tried testflightapp.com and I surprised. Because only by installing their profiling
Is there any .NET performance profiling tool out there that I can attach to
I am running this code to see the performance impact of the keyczar encryption
I'm attempting to time code using RDTSC (no other profiling software I've tried is
I am profiling a java process which is running on 64 bit JVM on
I've been profiling some of our core math on an Intel Core Duo, and
I have tried to use Webgrind for profiling my application but when I click
I'm currently profiling my app and coming across a few leaks. I've tried releasing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.