startup-time 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4a81d32c87d33dc6e8dd9099982be606ac59256d5968350e109f97979ee96eb
4
- data.tar.gz: 0200de23b714da4f6d45f4267e563e54217573fb58fbf66bf1d0ca1016eebd63
3
+ metadata.gz: 377344af2f7a7802b54695b2027e04f43d7c87bd6d9af5bfc4292300c3b226e2
4
+ data.tar.gz: e2dc97fca65d09d04df5c132a8b5553f675be80b564b9dc2bc7f3a4dde1b5d01
5
5
  SHA512:
6
- metadata.gz: 49c7f9e3e518859dcd7735bb101f6f4e5f48bf6d5a7da890efaf1951de58c0e89cef93a2f447fa4bc677d4cda2fa2aaf24ae9d58fe09683507a65dd9f6b5ca1c
7
- data.tar.gz: 9b7dfff84fb1b333aefdd5ff19c176f9e9238754fd52aeac4c9cdf2c18f3fdc5930af7d9ed61ce4fdd2ec44520e15ce8a268a453ed367afd5b4e4d7c4bd60a44
6
+ metadata.gz: ff0b44c9fac210362dab891ee279f9b9cfeaffb878e96007bc3d44cb180db835c43b86c82bd5214eb04e48ea8a8ec92616c04fd09b57b8daaf049f22c33dbcd3
7
+ data.tar.gz: 5fe70d4707bee6f8c8e33957170c2d1e99b239ac921b6d4c94cb6c2a927c3840a62418a6e23335beae722ae50a687fd759949a5a34ae038164d10ff14dec2327
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 1.1.1 - 2019-07-13
2
+
3
+ - add QuickJS
4
+ - fix deno version command
5
+
1
6
  ## 1.1.0 - 2019-02-27
2
7
 
3
8
  - dump the version of the compiler/interpreter in verbose mode
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
- <!-- START doctoc generated TOC please keep comment here to allow auto update -->
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
- <!-- END doctoc generated TOC please keep comment here to allow auto update -->
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 execute each test (default: 10)
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: ${XDG_CONFIG_HOME:-~/.cache/startup-time})
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 execute the specified tests (comma-separated list of IDs/groups)
89
- -O, --omit LIST Don't execute the specified tests (comma-separated list of IDs/groups)
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.0
145
+ 1.1.1
146
146
 
147
147
  ## COPYRIGHT AND LICENSE
148
148
 
@@ -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 dir
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
@@ -104,14 +104,14 @@ module StartupTime
104
104
  end
105
105
  end
106
106
 
107
- # update the test hash's compiler field to point to the compiler's
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. Rake passes an
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]`. since we're not relying on Rake's
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.load_file(TEST_DATA).with_indifferent_access
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StartupTime
4
- VERSION = '1.1.0'
4
+ VERSION = '1.1.1'
5
5
  end
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.0
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-02-27 00:00:00.000000000 Z
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.2
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