winr 1.0.2 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/bin/winr +9 -12
  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: 92cf6d6550696708f56fbdaf257a4dc03c45f492d29da6e48c6402475e5b6071
4
- data.tar.gz: a5453c06028778540c0c46d1822917a634dd295f2689cc96eed153ed436c7e7e
3
+ metadata.gz: 38f86d556218355c4e595fb33774565d9ccda930368801e5a22f132836e0fb18
4
+ data.tar.gz: 502c9dbceec99afd1194380bb27421fcfa240fe74d09f1c6e159ef53720c28b9
5
5
  SHA512:
6
- metadata.gz: d2b10ae402f1d2852fb383d8ac37edaa62bd745934f69b7365cf4ffd11030fe1e7ec33e663a8b375ea35dc81ee7f89d5c31332735117ee24e23c307ee6f6ef9c
7
- data.tar.gz: ef2bddad89692a60e7f0eb3f06d7644c029918bd2bfbe10916ae4fe307b58fd32470ee6c203cfa3bc655c09d506878149da969739bdc655e78cbcfdf831cba58
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 %>
@@ -236,7 +235,7 @@ cs = $config.contexts || [{}]
236
235
  ts = $config.tasks || [{}]
237
236
 
238
237
  # adjust script fields, if needed
239
- [es, cs].each do |item|
238
+ [*es, *cs].each do |item|
240
239
  if item.script
241
240
  if item.begin || item.end
242
241
  abort "scripts for environments and contexts should go into begin or end"
@@ -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.2"
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.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve