startup-time 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +38 -38
- data/lib/startup_time/app.rb +8 -2
- data/lib/startup_time/builder.rb +3 -3
- data/lib/startup_time/registry.rb +1 -1
- data/lib/startup_time/version.rb +1 -1
- data/resources/tests.yaml +12 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 377344af2f7a7802b54695b2027e04f43d7c87bd6d9af5bfc4292300c3b226e2
|
4
|
+
data.tar.gz: e2dc97fca65d09d04df5c132a8b5553f675be80b564b9dc2bc7f3a4dde1b5d01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff0b44c9fac210362dab891ee279f9b9cfeaffb878e96007bc3d44cb180db835c43b86c82bd5214eb04e48ea8a8ec92616c04fd09b57b8daaf049f22c33dbcd3
|
7
|
+
data.tar.gz: 5fe70d4707bee6f8c8e33957170c2d1e99b239ac921b6d4c94cb6c2a927c3840a62418a6e23335beae722ae50a687fd759949a5a34ae038164d10ff14dec2327
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,16 +3,15 @@
|
|
3
3
|
[![Build Status](https://travis-ci.org/chocolateboy/startup-time.svg)](https://travis-ci.org/chocolateboy/startup-time)
|
4
4
|
[![Gem Version](https://img.shields.io/gem/v/startup-time.svg)](https://rubygems.org/gems/startup-time)
|
5
5
|
|
6
|
-
<!--
|
7
|
-
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
6
|
+
<!-- toc -->
|
8
7
|
|
9
8
|
- [NAME](#name)
|
10
9
|
- [INSTALLATION](#installation)
|
11
10
|
- [SYNOPSIS](#synopsis)
|
11
|
+
- [Sample Output](#sample-output)
|
12
12
|
- [DESCRIPTION](#description)
|
13
13
|
- [Why?](#why)
|
14
14
|
- [OPTIONS](#options)
|
15
|
-
- [SAMPLE OUTPUT](#sample-output)
|
16
15
|
- [PREREQUISITES](#prerequisites)
|
17
16
|
- [REFERENCES](#references)
|
18
17
|
- [SEE ALSO](#see-also)
|
@@ -20,7 +19,7 @@
|
|
20
19
|
- [VERSION](#version)
|
21
20
|
- [COPYRIGHT AND LICENSE](#copyright-and-license)
|
22
21
|
|
23
|
-
<!--
|
22
|
+
<!-- tocstop -->
|
24
23
|
|
25
24
|
## NAME
|
26
25
|
|
@@ -54,6 +53,36 @@ $ startup-time --only fast --omit slow-compile
|
|
54
53
|
$ startup-time --count 100
|
55
54
|
```
|
56
55
|
|
56
|
+
### Sample Output
|
57
|
+
|
58
|
+
Test Time (ms)
|
59
|
+
C (gcc) 0.33
|
60
|
+
Nim 0.44
|
61
|
+
Kotlin Native 0.61
|
62
|
+
LuaJIT 0.64
|
63
|
+
Go 0.66
|
64
|
+
Rust 0.67
|
65
|
+
D (DMD) 0.88
|
66
|
+
JavaScript (QuickJS) 0.92
|
67
|
+
Lua 0.98
|
68
|
+
D (GDC) 1.10
|
69
|
+
Haskell (GHC) 1.14
|
70
|
+
C++ (g++) 1.22
|
71
|
+
Crystal 1.63
|
72
|
+
Perl 1.66
|
73
|
+
Java Native (GraalVM) 1.95
|
74
|
+
Bash 2.67
|
75
|
+
JavaScript (Deno) 11.15
|
76
|
+
Python 3 22.09
|
77
|
+
JavaScript (GraalVM) 32.38
|
78
|
+
JavaScript (Node.js) 35.20
|
79
|
+
Python 2 43.43
|
80
|
+
Java 54.59
|
81
|
+
Ruby 67.40
|
82
|
+
Ruby (TruffleRuby) 81.77
|
83
|
+
Kotlin 103.02
|
84
|
+
Scala 801.21
|
85
|
+
|
57
86
|
## DESCRIPTION
|
58
87
|
|
59
88
|
A command-line tool which measures how long it takes to execute ["Hello, world!"](https://en.wikipedia.org/wiki/%22Hello,_World!%22_program)
|
@@ -77,50 +106,21 @@ USAGE:
|
|
77
106
|
|
78
107
|
OPTIONS:
|
79
108
|
|
80
|
-
-c, --count, --rounds INTEGER The number of times to
|
109
|
+
-c, --count, --rounds INTEGER The number of times to run each test (default: 10)
|
81
110
|
--clean Remove the build directory and exit
|
82
111
|
(targets will be recompiled on the next run)
|
83
112
|
-d, --dir PATH Specify the build directory
|
84
|
-
(default: ${
|
113
|
+
(default: "${XDG_CACHE_HOME:-~/.cache}/startup-time")
|
85
114
|
-h, --help Show this help message and exit
|
86
115
|
-H, --help-only, --help-omit Show the IDs and groups that can be passed to --only and --omit
|
87
116
|
-j, --json Output the results in JSON format (implies --quiet)
|
88
|
-
-o, --only LIST Only
|
89
|
-
-O, --omit LIST Don't
|
117
|
+
-o, --only LIST Only run the specified tests (comma-separated list of IDs/groups)
|
118
|
+
-O, --omit LIST Don't run the specified tests (comma-separated list of IDs/groups)
|
90
119
|
-q, --quiet Suppress all inessential output
|
91
120
|
-v, --verbose Enable verbose logging
|
92
121
|
-V, --version Display the version and exit
|
93
122
|
```
|
94
123
|
|
95
|
-
## SAMPLE OUTPUT
|
96
|
-
|
97
|
-
Test Time (ms)
|
98
|
-
C (gcc) 0.33
|
99
|
-
Nim 0.44
|
100
|
-
Kotlin Native 0.61
|
101
|
-
LuaJIT 0.64
|
102
|
-
Go 0.66
|
103
|
-
Rust 0.67
|
104
|
-
D (DMD) 0.88
|
105
|
-
Lua 0.98
|
106
|
-
D (GDC) 1.10
|
107
|
-
Haskell (GHC) 1.14
|
108
|
-
C++ (g++) 1.24
|
109
|
-
Perl 1.69
|
110
|
-
Java Native (GraalVM) 1.95
|
111
|
-
Crystal 2.10
|
112
|
-
Bash 3.36
|
113
|
-
JavaScript (Deno) 11.15
|
114
|
-
Python 3 25.68
|
115
|
-
JavaScript (GraalVM) 32.38
|
116
|
-
Java 54.59
|
117
|
-
Python 2 56.30
|
118
|
-
JavaScript (Node.js) 70.39
|
119
|
-
Ruby 77.04
|
120
|
-
Ruby (TruffleRuby) 81.77
|
121
|
-
Kotlin 103.02
|
122
|
-
Scala 801.21
|
123
|
-
|
124
124
|
## PREREQUISITES
|
125
125
|
|
126
126
|
- Ruby >= 2.4
|
@@ -142,7 +142,7 @@ OPTIONS:
|
|
142
142
|
|
143
143
|
## VERSION
|
144
144
|
|
145
|
-
1.1.
|
145
|
+
1.1.1
|
146
146
|
|
147
147
|
## COPYRIGHT AND LICENSE
|
148
148
|
|
data/lib/startup_time/app.rb
CHANGED
@@ -1,11 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'benchmark'
|
4
|
-
require 'bundler/setup'
|
5
4
|
require 'komenda'
|
6
5
|
require 'shellwords' # for Array#shelljoin
|
7
6
|
require 'tty/table'
|
8
7
|
|
8
|
+
# FIXME we only need bundler/setup here, but it appears to create an incomplete
|
9
|
+
# Bundler object which (sometimes) confuses Komenda as well as causing a
|
10
|
+
# Gem::LoadError (for unicode-display_width)
|
11
|
+
#
|
12
|
+
# require 'bundler/setup'
|
13
|
+
require 'bundler'
|
14
|
+
|
9
15
|
module StartupTime
|
10
16
|
# StartupTime::App - the entry point for the app.
|
11
17
|
# selects an action based on the command-line options and runs it.
|
@@ -27,7 +33,7 @@ module StartupTime
|
|
27
33
|
end
|
28
34
|
|
29
35
|
# run the command corresponding to the command-line options:
|
30
|
-
# either an auxiliary command (e.g. clean the build
|
36
|
+
# either an auxiliary command (e.g. clean the build directory
|
31
37
|
# or print a help message) or the default command, which runs
|
32
38
|
# the selected benchmark-tests
|
33
39
|
def run
|
data/lib/startup_time/builder.rb
CHANGED
@@ -104,14 +104,14 @@ module StartupTime
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
-
# update the test
|
107
|
+
# update the test spec's compiler field to point to the compiler's
|
108
108
|
# absolute path (which may be mocked)
|
109
109
|
test = test.merge(compiler: compiler_path)
|
110
110
|
|
111
|
-
# pass the test object as the block's second argument.
|
111
|
+
# pass the test object as the block's second argument. Rake passes an
|
112
112
|
# instance of +Rake::TaskArguments+, a Hash-like object which provides
|
113
113
|
# access to the command-line arguments for a Rake task e.g. { name:
|
114
|
-
# "world" } for `rake greet[world]`.
|
114
|
+
# "world" } for `rake greet[world]`. since we're not relying on Rake's
|
115
115
|
# limited option-handling support, we have no use for that here, so we
|
116
116
|
# simply replace it with the test data.
|
117
117
|
wrapper = ->(task, _) { yield(task, test) }
|
@@ -20,7 +20,7 @@ module StartupTime
|
|
20
20
|
|
21
21
|
# the top-level hash in tests.yaml. keys are test IDs (e.g. "ruby"); values
|
22
22
|
# are test specs
|
23
|
-
TESTS = YAML.
|
23
|
+
TESTS = YAML.safe_load(File.read(TEST_DATA)).with_indifferent_access
|
24
24
|
|
25
25
|
# perform some basic sanity checks on the test specs and populate the group
|
26
26
|
# -> tests map
|
data/lib/startup_time/version.rb
CHANGED
data/resources/tests.yaml
CHANGED
@@ -30,6 +30,7 @@ deno:
|
|
30
30
|
groups:
|
31
31
|
- js
|
32
32
|
- script
|
33
|
+
version: '%{compiler} version | head -n1'
|
33
34
|
command:
|
34
35
|
- deno
|
35
36
|
- hello.js
|
@@ -220,6 +221,17 @@ node:
|
|
220
221
|
- node
|
221
222
|
- hello.js
|
222
223
|
|
224
|
+
quickjs:
|
225
|
+
name: JavaScript (QuickJS)
|
226
|
+
groups:
|
227
|
+
- fast
|
228
|
+
- js
|
229
|
+
- script
|
230
|
+
version: '%{compiler} --help | head -n1'
|
231
|
+
command:
|
232
|
+
- qjs
|
233
|
+
- hello.js
|
234
|
+
|
223
235
|
perl5:
|
224
236
|
name: Perl
|
225
237
|
groups:
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: startup-time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chocolateboy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
212
|
- !ruby/object:Gem::Version
|
213
213
|
version: '0'
|
214
214
|
requirements: []
|
215
|
-
rubygems_version: 3.0.
|
215
|
+
rubygems_version: 3.0.4
|
216
216
|
signing_key:
|
217
217
|
specification_version: 4
|
218
218
|
summary: A command-line tool to measure the startup times of programs in various languages
|