An open collection of Ruby benchmarks.
Ruby On Speed (ROS) allows you to run your Ruby code idioms in an elegant and reproducible way. It's based on the wonderful Benchmark/Ips gem and provides an easy to use DSL to create the benchmark collection.
./bin/ros help
./bin/ros list
./bin/ros test
./bin/ros run
- Array:combine - create an combined Array
- Array:compact - remove all nil elements from an Array
- Array:concat - concatenate two Arrays
- Array:contains - check if an Array contains an element
- Array:contains_array - Array elements included in another Array
- Array:copy - create a copy of an Array
- Array:empty - use of an empty Array
- Array:fill - create an Array with Integers
- Array:find_sorted - find element in a sorted Array
- Array:first - access the first element of an Array
- Array:group - group Array in number of sub-arrays
- Array:index - find the index of an Array element
- Array:index_iterate - iterate all elements
- Array:iterate - iterate over all Array elements
- Array:last - access the last element of an Array
- Array:map - modify all elements of an Array
- Array:map_some - modify
- Array:min - find the lowest element of an Array
- Array:pack - pack a binary sequence
- Array:sample - get a random element of an Array
- Array:size - get the count of Array entries
- Array:unique - remove all duplicates from an Array
- Boolean:assign - assign value
- Date:distance - calculate number of days between two dates
- Float:const - float constants
- Float:from_string - convert a String to Float
- Float:square - calculate the square of a Float
- Float:zero - test if a Float is zero
- Hash:access - get values of Hash in Hash
- Hash:copy - create a copy of a Hash
- Hash:from_array - create a Hash from an Array
- Hash:from_indexed_array - create a Hash from positional Array
- Hash:invalid_value - find non-existing value of Hash
- Hash:merge - merge two Hashes
- Hash:store - add a key/value pair to a Hash
- Hash:symbolize - symbolize all keys of a Hash
- Hash:value - find value from a key
- Integer:from_string - convert a String to Integer
- Integer:min_max - find min and max
- Integer:rand - check 50% chance
- Integer:range - check if value is in a range
- Integer:square - calculate the square of a Integer
- Integer:zero - test if an Integer is zero
- Object:class - test if an Object is derived from a Class
- Object:method_argument - test (default) arguments
- Object:respond_to - test if object responds to
- Proc:call - call a Proc with parameters
- Proc:to_proc - to_proc vs. call
- Range:comparison - is a Comparable in a Range
- Range:rand - get a random element of a Range
- Range:to_a - convert a Range to an Array
- Regexp:match - find Match of an Regexp
- Ruby:CONST - using a constant
- Ruby:accessor - access object member
- Ruby:any - single test vs. any
- Ruby:assign - variable assignment
- Ruby:block - call a block
- Ruby:const - const value access
- Ruby:const_get - get a constant value
- Ruby:endless_loop - different (nearly) endless loops
- Ruby:forwarding - forward a call
- Ruby:if - if vs. ternary if vs. and
- Ruby:loop - different loops
- Ruby:method_call - calling methods
- Ruby:variable - access a value
- String: replace_first - replace first sub string
- String::format - format a Float with two digits
- String:casecmp - comparing two Strings case-insensitive
- String:concat - concat two Strings
- String:contains - test if a String contains another String
- String:copy - create a String copy
- String:line_split - split lines
- String:lines_count - count number of lines
- String:remove_char - remove a single char
- String:remove_chars - remove some chars
- String:replace - replace all sub strings
- String:start - test if s String starts with a given String
- String:unpack - Integers from binary String
- Struct:access - access member Struct/Hash
- Struct:access_cmp - read access member Struct/Data/Hash
- Struct:create - create a Struct/Data/Hash
- Struct:member - access the member of a Struct
- Symbol:convert - convert to a Symbol