winr 1.0.3 → 1.0.4

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/bin/winr +8 -11
  4. data/winr.gemspec +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b02cb3ee3438dce04a4e679a3185cefa7fb186ec55ba5420cf7360af5bd48ca3
4
- data.tar.gz: c167107fd079c1fef8a2f1a9e2cb83a45c22bb45f49b52bc37fec84f6a286094
3
+ metadata.gz: 38f86d556218355c4e595fb33774565d9ccda930368801e5a22f132836e0fb18
4
+ data.tar.gz: 502c9dbceec99afd1194380bb27421fcfa240fe74d09f1c6e159ef53720c28b9
5
5
  SHA512:
6
- metadata.gz: f00715da9e686d79aa799000d14646af8fdc0586b86ed733a6e4dbac8e6ae9b649315829d3115f3cb1a048457802b3f0e8c25ad965fa6507449d93b84d9cc785
7
- data.tar.gz: 28f1d9e66cc0eaebb5890b39b2c1a40d9b19123a910ba821c6fff139817d92730cf1ab868dd9be6b60666d9562f5bf0319c51a54cb35fb15f72a8a3e1bd97a1c
6
+ metadata.gz: 7f452bc2804419bb14b818613351cd963663bf8f191138e481662f5ca8850d8045d46985a8b412753aae7179bc9fc1c91f57ed414af59e97561db6eec00e1deb
7
+ data.tar.gz: 1cf7d74de6ecebef12d73c6e257db1e4fc76d3a4d5c1b115b22f5bda22d549dd9144f2a81816fcc6e045fb0843d6234496118ca3885a9a84f94a24efac1b0057
data/README.md CHANGED
@@ -143,7 +143,7 @@ Available statistics:
143
143
 
144
144
  ips iterations per second
145
145
  loops number of iterations
146
- spi seconds for iteration
146
+ spi seconds per iteration
147
147
  time time to run all iterations
148
148
  ```
149
149
 
data/bin/winr CHANGED
@@ -39,7 +39,7 @@ OptionParser.new.instance_eval do
39
39
 
40
40
  ips iterations per second
41
41
  loops number of iterations
42
- spi seconds for iteration
42
+ spi seconds per iteration
43
43
  time time to run all iterations
44
44
  end
45
45
 
@@ -160,8 +160,7 @@ def template
160
160
 
161
161
  trap("INT") { exit }
162
162
 
163
- # def __winr_timer; Process.clock_gettime(Process::CLOCK_MONOTONIC); end
164
- def __winr_timer; Time.now.to_f; end
163
+ def __winr_timer; Process.clock_gettime(Process::CLOCK_MONOTONIC); end
165
164
 
166
165
  <%= e.begin %>
167
166
  <%= c.begin %>
@@ -259,21 +258,19 @@ puts "```", [$0, *ARGV].shelljoin, "" unless hush
259
258
 
260
259
  # loop over environment(s)
261
260
  es.each_with_index do |e, ei|
262
- puts IO.popen(["ruby", "-v"].join(" "), &:read) unless hush
263
- puts rt
264
261
 
265
- # TODO: read this from e.command
262
+ # TODO: get command from environment
266
263
  command = ["/usr/bin/env ruby"]
267
-
268
- # loop over context(s) and task(s)
269
- ys, xs = swap ? [ts, cs] : [cs, ts]
264
+ puts IO.popen(["ruby", "-v"].join(" "), &:read) unless hush
270
265
 
271
266
  # row: content, header
267
+ ys, xs = swap ? [ts, cs] : [cs, ts]
272
268
  rc = "Task" # or "Context"
273
269
  rh = "│ %-*.*s │" % [wide, wide, e.name(es.size > 1 ? "Env ##{ei + 1}" : rc)]
274
270
  rh = xs.inject(rh) {|s, x| s << " %-*.*s │" % [full, full, x.name("Results").center(full)] }
275
- puts rh, rm
271
+ puts rt, rh, rm
276
272
 
273
+ # loop over context(s) and task(s)
277
274
  ys.each_with_index do |y, yi|
278
275
  print "│ %-*.*s │" % [wide, wide, y.name("Results")]
279
276
  xs.each_with_index do |x, xi|
@@ -281,6 +278,7 @@ es.each_with_index do |e, ei|
281
278
  delay = Tempfile.open(['winr-', '.rb']) do |file|
282
279
  t.loops = runs if runs
283
280
  code = tmpl.result(binding).rstrip + "\n"
281
+ puts "", "", code, "=" * 78, "" if hack
284
282
  write(file, code) do |path|
285
283
  runs, time = execute(command, path)
286
284
  t.loops ||= runs
@@ -288,7 +286,6 @@ es.each_with_index do |e, ei|
288
286
  rank << [runs/time, ei, ci, ti]
289
287
  print vals.zip(cols).map {|pair| " %s │" % scale(*pair) }.join
290
288
  end
291
- puts "", code, "=" * 78 if hack
292
289
  end
293
290
  end
294
291
  print "\n"
data/winr.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "winr"
5
- s.version = "1.0.3"
5
+ s.version = "1.0.4"
6
6
  s.author = "Steve Shreeve"
7
7
  s.email = "steve.shreeve@gmail.com"
8
8
  s.summary =
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: winr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve