# Insertion and removal time for ruby datastructures

**URL:** <https://www.ruby-forum.com/t/insertion-and-removal-time-for-ruby-datastructures/173312>\
**Category:** Ruby\
**Created:** [August 6, 2009, 4:55pm UTC](https://www.ruby-forum.com/t/insertion-and-removal-time-for-ruby-datastructures/173312 "2009-08-06T16:55:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/d07c76/32.png) [@nicken](https://www.ruby-forum.com/u/nicken)\
**Post date:** [August 6, 2009, 4:55pm UTC](https://www.ruby-forum.com/t/insertion-and-removal-time-for-ruby-datastructures/173312/1 "2009-08-06T16:55:40Z")

</div>

Has anyone ever analyzed the built-in ruby datastructures (array, hash,  
set, etc.) for their insertion, removal, and look-up times? I regularly  
use ruby to handle very large datasets, so this sort of information  
would be quite useful to me. For example, in some cases, I would happily  
go with a structure that had exponential insertion cost if it meant I  
could get logarithmic look-up cost (rather than linear cost).

Has any work been done along these lines?

Also, It would be really great if this info were included as part of the  
standard library.
