Remove ruby inline and c function call - #24
Closed
milus wants to merge 2 commits into
Closed
Conversation
Owner
|
Should we remove BigDecimal entirely as well? |
sk-
added a commit
to sk-/xirr
that referenced
this pull request
Apr 30, 2024
For some reason the commit added (tubedude@0c89d72) to remove RubyInline is not the same as PR tubedude#24, and a require was left in the code. That require fails, as the dependency is no longer specified. And that makes the test to fail: ``` $ bundle exec rake test_units /Users/coder/.rbenv/versions/3.3.1/lib/ruby/3.3.0/bundled_gems.rb:74:in `require': cannot load such file -- inline (LoadError) from /Users/coder/.rbenv/versions/3.3.1/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require' from /Users/coder/code/xirr/lib/xirr/base.rb:7:in `<module:Base>' from /Users/coder/code/xirr/lib/xirr/base.rb:5:in `<module:Xirr>' from /Users/coder/code/xirr/lib/xirr/base.rb:3:in `<top (required)>' from /Users/coder/.rbenv/versions/3.3.1/lib/ruby/3.3.0/bundled_gems.rb:74:in `require' from /Users/coder/.rbenv/versions/3.3.1/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require' from /Users/coder/code/xirr/test/test_helper.rb:12:in `<top (required)>' from /Users/coder/code/xirr/test/test_cashflow.rb:1:in `require_relative' from /Users/coder/code/xirr/test/test_cashflow.rb:1:in `<top (required)>' from /Users/coder/.rbenv/versions/3.3.1/lib/ruby/3.3.0/bundled_gems.rb:74:in `require' from /Users/coder/.rbenv/versions/3.3.1/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require' from /Users/coder/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:21:in `block in <main>' from /Users/coder/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6:in `select' from /Users/coder/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6:in `<main>' rake aborted! Command failed with status (1) /Users/coder/.rbenv/versions/3.3.1/bin/bundle:25:in `load' /Users/coder/.rbenv/versions/3.3.1/bin/bundle:25:in `<main>' Tasks: TOP => test_units (See full trace by running task with --trace) ``` After the change, the tests are working again. PS: in a later PR I will be configuring Github Actions for this repo.
Owner
|
Thanks. Solved with #36 |
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.
Use pure ruby instead of
Inlinefeature. Since Ruby math functions are already implemented in C it does not impact on performance.In C extention
BigDecmialis casted todouble. Ruby'sFloatinternally is also implemented asdouble, so castingBigDecimaltoFloatin ruby has the same effect without compromising on performanceBenchmark:
Benchmark result: