3

Which CPU for an Intel Windows system would give the best performance for this example Python code?

import numpy as np

X = np.random.randn( 1e7, 10 )
Y = np.random.randn( 1e7, 1 )

%timeit I = X>Y

np.show_config()

The example code does not use multiple cores, so I am not sure if I need to get an expensive multicore i7 or not.

Could I be better off with an i5 that has a faster clock speed?

Also, how will the cpu cache affect these?

Note: Edited the original question to provide a concrete example.

Adding Unutbu's suggestions, my output is

1 loops, best of 3: 255 ms per loop
mkl_info:
    define_macros = [('SCIPY_MKL_H', None)]
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
blas_opt_info:
    define_macros = [('SCIPY_MKL_H', None)]
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
lapack_opt_info:
    define_macros = [('SCIPY_MKL_H', None)]
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd', 'mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
lapack_mkl_info:
    define_macros = [('SCIPY_MKL_H', None)]
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd', 'mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
blas_mkl_info:
    define_macros = [('SCIPY_MKL_H', None)]
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
openblas_lapack_info:
  NOT AVAILABLE

My CPU is an ancient i7 920 2.67GHz with 24.0GB Ram, Windows Vista Business 64 Bit

kmp
  • 10,535
  • 11
  • 75
  • 125
Ginger
  • 8,320
  • 12
  • 56
  • 99
  • 3
    The people downvoting this question are ridiculous. – Rick Dec 22 '14 at 21:13
  • 6
    No, they're not. It's going to depend on the operation done. cache locality and so on. As posed, it doesn't have an answer – The Archetypal Paul Dec 22 '14 at 21:14
  • 3
    From the question, the OP obviously doesn't know how these things work, but it's not the sort of question that lends itself to a simple google search. Where else other than SO can you ask something like this? As for not having an answer: "That's not how this works; let me explain how it does work..." IS AN ANSWER. Questions like this can often turn out to be extremely interesting when someone knowledgeable takes them on. – Rick Dec 22 '14 at 21:16
  • 3
    @RickTeachey, where? superuser.com for a start, and even then only after the question is focused and his requirements explained. – Leeor Dec 22 '14 at 21:19
  • I'll tweak my complaint in another direction then: there were at least 5 downvotes (I think I saw 6). None of them bothered to offer suggestions on how to improve the question. The idea behind the question has merit. If fleshed out, it could be really intriguing. – Rick Dec 22 '14 at 21:23
  • I have made the question more specific with a code sample. – Ginger Dec 22 '14 at 21:28
  • 1
    @RickTeachey: I agree with you that a knowledgeable person might be able to write a very interesting answer. But [this might shed some light](http://meta.stackexchange.com/questions/158809/why-are-shopping-list-questions-bad) on why these kinds of questions tend to get closed. Now, with the inclusion of Ginger's benchmark code, someone with an i5 and someone (maybe the same person) with an i7 could post benchmarks and CPU, OS and `np.show_config()` specs. So there is an objective way to answer the question. – unutbu Dec 22 '14 at 21:48
  • 1
    The question is much better now, although I would still try to narrow down the scope of comparison - i5 and i7 families both have a large range of products, with varying cache sizes and frequencies for each. – Leeor Dec 22 '14 at 22:16
  • 1
    @RickTeachey many programmers on SO have *no* idea about how to be useful to unexperienced programmers. Anyone who has some experience with other stack exchange communities is totally aware of this. – DaniPaniz Jan 12 '18 at 14:29

0 Answers0