From: Sam Smoot Date: 2008-02-17T03:29:57+09:00 Subject: Re: Decimal 0.0 released On Feb 15, 8:59 pm, Tadashi Saito wrote: > Hello all, > > I released Decimal 0.0 somehow, an arithmetic extension library for Ruby. > >  http://decimal.rubyforge.org/ > > Decimal is the multi-precision decimal arithmetic library, which designed to > be comfortable with the existing Numeric classes first.  I'd like to make it > useful alike BigDecimal, that is in stdlib as you know. > > My purpose of the release is "to release," so its tarball must contains many > bugs in contrast to full of NO documents.  However, I guess you can use it > like BigDecimals and Floats, because most of the methods you need are already > implemented briefly. > > ...needs other explanations?  Yep, I'll show you some commands and its > results, instead of detailed self-introduction. > (note that my product's name is shorter one) > > $ cd ~/svn/ruby/trunk/ext/bigdecimal/ > $ wc -c bigdecimal.[ch] > 123348 bigdecimal.c >   8031 bigdecimal.h > 131379 total > > $ cd ~/svn/decimal/trunk/ > $ wc -c decimal.c >  37997 decimal.c > > $ time ruby -rbigdecimal -e 'BigDecimal("1.1") ** (2 ** 16)' > > real    0m9.462s > user    0m9.433s > sys     0m0.008s > > $ time ruby -rdecimal -e 'Decimal("1.1") ** (2 ** 16)' > > real    0m0.338s > user    0m0.328s > sys     0m0.000s > > $ cat mem.rb > def mem >   File.read("/proc/#{$$}/status").grep(/VmSize/) > end > > $ ruby -rmem -rbigdecimal -e 'GC.disable; d=BigDecimal("1"); 2_000_000.times {d+d}; puts mem' > VmSize:   129208 kB > > $ ruby -rmem -rdecimal -e 'GC.disable; d=Decimal(1); 2_000_000.times {d+d}; puts mem' > VmSize:    82340 kB > > These improved your image? > > In addition, this is my first release of software products.  I'm little > unsure of myself, so I welcome any comments from the community to a novice. > > # I hope it will be included in Ruby trunk, before the 1.9.0xFF was released. > > -- > Tadashi Saito Very nice. I'd love to see this developed further. As a contributor to DataMapper, one of the things I'm most interested in is faster/less- memory-hungry "Primitive" types. I could see a library like yours having a big impact... keep up the good work, and please, let us know the moment you think it's ready for wide-spread use! :-)