Syndication Icon
Published October 29, 2019 Updated May 11, 2020

Benchmarks

  • Duration

    01:06

  • Operating System

    macOS

  • Shell

    bash

  • Terminal

    xterm

Transcript

# Hello and welcome to the Alchemists Screencasts!
# Today, we'll look at micro benchmarking in Ruby:
# https://www.alchemists.io/projects/benchmarks

# We'll start by cloning the repository:

git clone https://github.com/bkuhlmann/benchmarks.git
cd benchmarks

# You can pick any file in the *scripts* folder to run a benchmark:

ruby scripts/ruby/structs/construction.rb

# Here we see a Hash is the fastest to construct.
# Let's try another:

ruby scripts/ruby/strings/concatenation.rb

# In this benchmark, we see interpolation is faster than using arrays.

# Those are only a few examples of benchmarks found in this project.
# For more details, check out the source code.

# Enjoy!
# https://www.alchemists.io
# ☿ 🜔 🜍 🜂 🜃 🜁 🜄