1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext
Kenta Murata 4ba3a4491e
[ruby/bigdecimal] Optimize rb_float_convert_to_BigDecimal by using dtoa
This improve the conversion speed several times faster than before.

```
RUBYLIB= BUNDLER_ORIG_RUBYLIB= /home/mrkn/.rbenv/versions/3.0.0/bin/ruby -v -S benchmark-driver /home/mrkn/src/github.com/ruby/bigdecimal/benchmark/from_float.yml
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
Calculating -------------------------------------
                     bigdecimal 3.0.0      master
              flt_e0         156.400k    783.356k i/s -    100.000k times in 0.639388s 0.127656s
            flt_ep10         158.640k    777.978k i/s -    100.000k times in 0.630359s 0.128538s
           flt_ep100         101.676k    504.259k i/s -    100.000k times in 0.983512s 0.198311s
            flt_em10         103.439k    726.339k i/s -    100.000k times in 0.966751s 0.137677s
           flt_em100          79.675k    651.446k i/s -    100.000k times in 1.255095s 0.153505s

Comparison:
                           flt_e0
              master:    783355.6 i/s
    bigdecimal 3.0.0:    156399.5 i/s - 5.01x  slower

                         flt_ep10
              master:    777977.6 i/s
    bigdecimal 3.0.0:    158639.7 i/s - 4.90x  slower

                        flt_ep100
              master:    504259.4 i/s
    bigdecimal 3.0.0:    101676.5 i/s - 4.96x  slower

                         flt_em10
              master:    726338.6 i/s
    bigdecimal 3.0.0:    103439.2 i/s - 7.02x  slower

                        flt_em100
              master:    651446.3 i/s
    bigdecimal 3.0.0:     79675.3 i/s - 8.18x  slower

```

https://github.com/ruby/bigdecimal/commit/5bdaedd530
https://github.com/ruby/bigdecimal/commit/9bfff57f90
https://github.com/ruby/bigdecimal/commit/d071a0abbb
2021-01-13 02:11:18 +09:00
..
-test- Get rid of defining methods for tests in core classes 2021-01-09 22:38:06 +09:00
bigdecimal [ruby/bigdecimal] Optimize rb_float_convert_to_BigDecimal by using dtoa 2021-01-13 02:11:18 +09:00
cgi/escape cgi/escape is ractor-safe 2020-12-20 04:22:29 +09:00
continuation sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
coverage Expose atomic operation macros with RUBY prefix 2020-12-24 11:43:21 +09:00
date [ruby/date] Define dummy RUBY_TYPED_FROZEN_SHAREABLE for old Ruby 2020-12-23 18:32:24 +09:00
dbm sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
digest [ruby/digest] Remove .gitignore and .travis.yml from gemspec 2020-12-21 17:46:30 +09:00
etc [ruby/etc] Added fallback definition of RUBY_ATOMIC_EXCHANGE 2021-01-11 11:39:12 +09:00
fcntl sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
fiber
fiddle [fiddle] Update to 1.0.6 2020-12-23 23:40:04 +09:00
gdbm sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
io [ruby/io-console] Shrink struct query_args 2021-01-05 21:26:15 +09:00
json Merge json-2.5.1 2020-12-22 21:51:15 +09:00
monitor Fix a typo [ci skip] 2021-01-05 23:10:39 +09:00
nkf sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
objspace enable constant cache on ractors 2021-01-05 02:27:58 +09:00
openssl support Ruby 2.x for openssl 2020-12-19 02:05:08 +09:00
pathname [pathname] Make Pathname Ractor safe (#3940) 2020-12-20 00:40:47 +09:00
psych [ruby/psych] Bump version to 3.3.0 2020-12-23 19:53:21 +09:00
pty [DOC] Fix grammar: "is same as" -> "is the same as" 2021-01-05 15:13:53 +01:00
racc/cparse ext/racc/cparse is ractor-safe 2020-12-20 04:22:29 +09:00
rbconfig/sizeof sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
readline Get rid of inconsistent dll linkages against vcpkg readline 2020-12-27 19:35:27 +09:00
ripper ripper: call #pretty_print on also state 2021-01-04 23:37:00 +09:00
rubyvm
socket [DOC] Fix grammar: "is same as" -> "is the same as" 2021-01-05 15:13:53 +01:00
stringio Removed rb_cData entity 2020-12-22 02:51:49 +09:00
strscan [strscan] Fix license comment and files 2020-12-18 14:25:48 +09:00
syslog Promote syslog to default gems 2020-09-10 20:42:53 +09:00
win32 [DOC] Fix grammar: "is same as" -> "is the same as" 2021-01-05 15:13:53 +01:00
win32ole Add string encoding IBM720 alias CP720 (#3803) 2020-11-22 22:23:40 +09:00
zlib zlib is ractor-safe 2020-12-18 14:09:32 +09:00
.document Remove unnecessary files from .document 2020-12-20 16:00:13 +09:00
extmk.rb transcode-tblgen.rb: make silent a little when just -v 2020-12-29 17:45:19 +09:00
Setup Removed sdbm entries from toolchanins 2020-06-19 08:26:47 +09:00
Setup.atheos Removed sdbm entries from toolchanins 2020-06-19 08:26:47 +09:00
Setup.nt Removed sdbm entries from toolchanins 2020-06-19 08:26:47 +09:00