startup-time

Build Status Gem Version

NAME

startup-time - a command-line benchmarking tool which measures the startup times of programs in various languages

INSTALLATION

$ gem install startup-time

SYNOPSIS

# run all available tests
$ startup-time

# only run the "fast" tests
$ startup-time --only fast

# run all but the "slow" tests
$ startup-time --omit slow

# only run the JVM tests (e.g. Java, Scala etc.)
$ startup-time --only jvm

# only run tests which finish quickly
$ startup-time --only fast --omit slow-compile

# run the test suite for at least 10 seconds (default: 5)
$ startup-time --time 10

# run each program 10 times
$ startup-time --count 10

Sample Output

Test                  Time (ms)
C (gcc)                    0.33
Nim                        0.44
Kotlin Native              0.61
LuaJIT                     0.64
Go                         0.66
Rust                       0.67
JavaScript (QuickJS)       0.83
D (DMD)                    0.88
Lua                        0.94
Java Native (GraalVM)      0.99
D (GDC)                    1.10
Haskell (GHC)              1.14
Wren                       1.14
C++ (g++)                  1.19
Crystal                    1.55
Perl                       1.66
Bash                       2.63
JavaScript (GraalVM)       3.88
JavaScript (Deno)         11.15
Python 3                  22.09
Ruby (TruffleRuby)        33.59
JavaScript (Node.js)      35.20
Python 2                  43.43
Java                      54.59
Ruby                      68.68
Kotlin                   103.02
Scala                    801.21

DESCRIPTION

A command-line tool which measures how long it takes to execute "Hello, world!" programs written in various languages. It records the fastest time for each program and prints a sorted table of the times after each run. Apart from the prerequisites listed below, the tool doesn't require any of the tested languages to be installed: if a compiler/interpreter is not available, the test is skipped.

Why?

To determine which languages are practical (or impractical) to use for command-line interface (CLI) tools. Anything under 100 milliseconds is perceived as instantaneous. Anything over that is perceptibly delayed, which can impair interactivity and productivity on the command line, and can mean the difference between staying in the zone and losing your train of thought.

OPTIONS

USAGE:

    startup-time [options]

OPTIONS:

    -c, --count, --rounds INTEGER    The number of times to run each program
        --clean                      Remove the build directory and exit
                                     (targets will be recompiled on the next run)
    -d, --dir PATH                   Specify the build directory
                                     (default: "${XDG_CACHE_HOME:-~/.cache}/startup-time")
    -h, --help                       Show this help message and exit
    -H, --help-only, --help-omit     Show the IDs and groups that can be passed to --only and --omit
    -j, --json                       Output the results in JSON format (implies --quiet)
    -o, --only LIST                  Only run the specified tests (comma-separated list of IDs/groups)
    -O, --omit LIST                  Don't run the specified tests (comma-separated list of IDs/groups)
    -q, --quiet                      Suppress all inessential output
    -t, --time INTEGER               The minimum number of seconds to run the test suite for
                                     (minimum: 2, default: 10)
    -v, --verbose                    Enable verbose logging
    -V, --version                    Display the version and exit

PREREQUISITES

  • Ruby >= 2.4

REFERENCES

SEE ALSO

AUTHOR

chocolateboy

VERSION

1.3.0

Copyright © 2015-2019 by chocolateboy

This benchmark game is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.