Giter VIP home page Giter VIP logo

Comments (5)

SebastianSemper avatar SebastianSemper commented on June 8, 2024

from fastmat.

MichaelDoebereiner avatar MichaelDoebereiner commented on June 8, 2024

You're right, I'm referring to this part. Since this is called only once at this part of the code, you can take it as an annotation in general. ;-)

from fastmat.

ChristophWWagner avatar ChristophWWagner commented on June 8, 2024

I can confirm this is sort of performance-critical for larger orders. Assume you have an Fourier-based interpolator, this generation takes a couple of hundred ms for orders around ~1e6, which is not THAT large (but also not that small). I once observed bad performance when generating interpolator objects for varying data sizes but didn't attribute it to the exponential generation. If it is verified that that's the cause we should address it.

from fastmat.

MichaelDoebereiner avatar MichaelDoebereiner commented on June 8, 2024

I made a short example, where you can see that there are faster solutions than np.exp(). Allthough I don't know exactly what this numexpr module does.
Even a straight forward solution with sine and cosine is faster than np.exp().

Example:

x = np.random.randn(1000000,1)1j
%timeit np.exp(x)
70.4 ms ± 450 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
%timeit numexpr.evaluate('exp(x)')
16 ms ± 55 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
x = np.random.randn(1000000,1)
%timeit np.cos(x)+1j
np.sin(x)
46.6 ms ± 130 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)

from fastmat.

ChristophWWagner avatar ChristophWWagner commented on June 8, 2024

Modifications were introduced in v0.2 by d22813f. Closing.

from fastmat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.