Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Onebillionloops

A performance benchmarking tool that executes one billion loops to measure system performance using Elixir's concurrent capabilities.

Overview

This module implements a billion-loop benchmark using:

  • Chunked processing (1M iterations per chunk)
  • Concurrent execution using Task.async_stream
  • Automatic detection of available CPU schedulers
  • Tail-recursive implementation for memory efficiency

Usage

Run the benchmark in an IEx session:

# Start IEx with the project
iex -S mix

# The benchmark will automatically run and display timing results

Performance Details

  • Total iterations: 1,000,000,000
  • Chunk size: 1,000,000 (configurable)
  • Concurrency: Matches available CPU schedulers
  • Implementation: Tail-recursive countdown function

Installation

If available in Hex, the package can be installed by adding onebillionloops to your list of dependencies in mix.exs:

def deps do
  [
    {:onebillionloops, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/onebillionloops.

About

A high-performance Elixir micro-benchmark that executes 1 billion loop iterations in ~0.3 seconds, demonstrating the raw computational efficiency of Elixir’s tail-call optimization and the BEAM VM. Through iterative refinements—comparing naïve recursion, tail-recursive functions, and for-loops.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages