numpy / numpy.org

The NumPy home page
http://numpy.org/
BSD 3-Clause "New" or "Revised" License
111 stars 106 forks source link

Add content on performance (e.g. benchmarks, mention accelerators) #370

Open rgommers opened 3 years ago

rgommers commented 3 years ago

Related to https://github.com/numpy/numpy.org/issues/308#issuecomment-634612765 (connect content to "key features" on front page).

Adding content on benchmarks and accelerators (i.e. Cython, Numba, Pythran, Transonic) was also just suggested in https://mail.python.org/pipermail/numpy-discussion/2020-November/081248.html

melissawm commented 3 years ago

Do you have pointers on how those benchmarks should look like? Is there a preferred set of problems to test code in? See, for example https://julialang.org/benchmarks/

rgommers commented 3 years ago

The idea of that Julia page is about right I think, short and with only a plot, no code. The main things I'd change from that:

Off the top of my head I'm not sure about an existing widely used set of benchmarks to adopt.

paugier commented 3 years ago

Thanks @rgommers for opening this issue!

Few remarks:

rgommers commented 3 years ago

It would be interesting to also mention other aspects than elapsed times, for example readability, size of the files, technical difficulties, time of coding, maintainability, etc. Optimizing is always a balance.

That's a good point, yes.

It's also interesting to give at least one example using OpenMP.

I don't think I'd want to get into that, on the same page at least. Because then we'd also have to touch on other forms of parallelism (e.g. Dask, multiprocessing, asyncio).

This article https://onlinelibrary.wiley.com/iucr/doi/10.1107/S1600576719008471 is very interesting and serious. It should be cited.

Thanks, I wasn't aware of this article. It's really well-written.

It would be good to send two important messages in terms of performance: (i) no premature optimization and (2) measure, don't guess. We can at least mention CProfile.

I think the page really should focus on performance, rather than turning into a tutorial. So this can be one line to one paragraph, but it should link elsewhere for things like profiling.

rgommers commented 3 years ago

Adding links to the recent Nature correspondence by @paugier et al.: