Open
Conversation
Member
|
This is fine place to have the discussion - what else did you want to change? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a
numbaversion of the "better" IRR implementation. It doesn't do anything other than provide the code for a new benchmark, so this PR can live until all the things are in place.Note that in order for the
numbaversion to work, you need to convert thecfsarray to anumpyarray. If you pass in thenumpyarray to the original "better" version, you actually get a decent speedup (1.75x) -- I think that should be reflected in these benchmarks (either switch to that version or show both). On my machine, the three Newton/"better" runs benchmark as follows:In short, the
numbaversion is 26x faster than the original "better" and 15x faster than thenumpy-fed "better".A few other things to note:
numpyandtimetitimports are necessary, cashflow arrays hardcoded in code makes it less readable) so as not to accidentally break things.numbaversion on my own environment using Python 3.10.6 and made sure the result was the same as the "better" version. The fact that the benchmarks don't have a clear way to install an environment for someone to run is problematic IMO and should be addressed.I'd like to open an issue or discussion to discuss improvements to these benchmarks. I know you started an issue regarding more realistic array sizes in #3 but that's only one aspect I'd like to address. Let me know if I should open a new one or if there is a specific place you want to have that discussion.