Commit bf04ad4
authored
Make BigDecimal object embedded (#507)
Fix: #293
BigDecimal is a very good fit for embedded objects, as most of
them are small, and they're all immutable, so they don't need
any resizing.
In most case it results in smaller objects, but also reduces pointer
chasing as well as make these objects faster to free for the GC.
master:
```ruby
>> ObjectSpace.memsize_of(BigDecimal("422343434234234234234234234234423"))
=> 92
>> ObjectSpace.memsize_of(BigDecimal("4223434342342342342342342342344232342423423"))
=> 96
```
This branch:
```ruby
>> ObjectSpace.memsize_of(BigDecimal("422343434234234234234234234234423"))
=> 80
>> ObjectSpace.memsize_of(BigDecimal("4223434342342342342342342342344232342423423"))
=> 160
```1 parent 64834a8 commit bf04ad4
3 files changed
Lines changed: 116 additions & 174 deletions
0 commit comments