On 2016/03/07 14:17, shyouhei / ruby-lang.org wrote:
> (WIP is definitely OK with me.) Let me think of a more realistic use case.

I believe this is not frequent case. But Ruby is used by many people. We
need to care about the Shyouhei's example (if we can).

----

here is random version of deletion and addition test (not only last
element) (ref [ruby-core:74182]).

```ruby
require 'objspace'

h = 10.times.inject({}){|r, i| r[i] = i; r}
100_000.times{|i|
  key = rand(10)
  h.delete(key)
  # add
  h[key] = key
  puts "#{i}\t#{ObjectSpace.memsize_of(h)}" if (i % 1_000) == 0
}
```

result:
http://www.atdot.net/fp_store/f.jvrn3o/file.copipa-temp-image.png

-- 
// SASADA Koichi at atdot dot net

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>