Giter Club home page Giter Club logo

Comments (3)

Kai-Striega avatar Kai-Striega commented on August 25, 2024

@garfieldthecat I'm sorry that no one has taken the time to look at this. I've started doing some maintenance work on numpy-financial and have also noticed the speed to be an issue for some functions. At a glance, Numba seems to be a good fit here.

I'm currently in the process of adding asv benchmarks, once that's done would you still be interested in contributing?

from numpy-financial.

garfieldthecat avatar garfieldthecat commented on August 25, 2024

Sure, do let me know. A couple of comments:

  1. part of the reason why all the functions are very slow seems to be the fact that they are set up to accept both scalars and arrays as inputs. I have coded my own functions which accept only scalars and they're so much faster

  2. Numba is not even at version 1. I am not sure everyone can/wants to install it. By all means, do considera a numba implementation, but maybe as an option? If you make your functions rely on numba only it might be tricky

from numpy-financial.

Kai-Striega avatar Kai-Striega commented on August 25, 2024
  1. part of the reason why all the functions are very slow seems to be the fact that they are set up to accept both scalars and arrays as inputs. I have coded my own functions which accept only scalars and they're so much faster

The functions have been set up to act similarly to numpy ufuncs. I believe this can now be achieved using np.vectorize or np.fromfunc. Perhaps these are an avenue worth exploring?

There are more considerations, off the top of my head, this includes:

  1. Do they handle masked arrays
  2. Handling when (this could be expensive if vectorized)
  3. Handling Decimal datatype
  1. Numba is not even at version 1. I am not sure everyone can/wants to install it. By all means, do considera a numba implementation, but maybe as an option? If you make your functions rely on numba only it might be tricky

Good point. Numba was suggested to me by another NumPy developer and it's been sitting in the back of my mind while I've been working. Either way I'd prefer to have some full benchmarks before anything changes in the name of performance.

from numpy-financial.

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.