Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
base: 91d706492d50
Choose a base ref
...
head repository: jruby/jruby
compare: 8516d1f76512
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Oct 3, 2016

  1. Replace BigDecimal#!= by BigDecimal#nonzero?.

    The comparison is very expensive, because it first tries to convert the operand (which is a constant Integer 0 here) into a BigDecimal. This in turn is very expensive (because the Integer is first converted into a String, and then, for operating on that String, a java.util.regex.Pattern object is compiled (in line https://github.com/felixvf/jruby/blob/cc79119315496ea019496affe7a6a79ebc1dbed9/core/src/main/java/org/jruby/ext/bigdecimal/RubyBigDecimal.java#L533)). Using #nonzero? should speed-up the loop considerably.
    Felix von Ferey committed Oct 3, 2016
    1 Configuration menu
    Copy the full SHA
    3acd172 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #4199 from felixvf/fix_bigmath_log_performance

    Replace BigDecimal#!= by BigDecimal#nonzero?.
    kares committed Oct 3, 2016
    Configuration menu
    Copy the full SHA
    8516d1f View commit details
    Browse the repository at this point in the history