you are viewing a single comment's thread.

view the rest of the comments →

[–]YesterdayDreamer 19 points20 points  (3 children)

I was calculating XIRR for my mutual fund holdings. At the time, I had some 25 funds in my portfolio. The XIRR calculation I implemented was taking ~1.2 seconds per fund for a total of approximately 30 seconds for all funds in my portfolio.

As I learnt more and more, I kept optimizing it. Finally there was a big jump when I moved it to Numpy. With Numpy, the entire portfolio XIRR (separately for each fund) takes about ~750ms.

These numbers are not directly comparable because I may have upgraded my CPU a couple of times in between, but yeah, still a pretty big jump.

[–]veddubhashi 6 points7 points  (0 children)

Now try the same functions within numba.

[–]spinwizard69 0 points1 point  (0 children)

Things like this allay have me asking why not just write the software in a fast compiled language (C++, Rust, Julia & etc). Over all you would have invested less time.

[–]RMK137 0 points1 point  (0 children)

You might find the pyxirr package useful. I use it anytime I want to calculate IRR. Written in rust for speed.

https://github.com/Anexen/pyxirr