winr 1.0.2 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/bin/winr +9 -12
- data/winr.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38f86d556218355c4e595fb33774565d9ccda930368801e5a22f132836e0fb18
|
4
|
+
data.tar.gz: 502c9dbceec99afd1194380bb27421fcfa240fe74d09f1c6e159ef53720c28b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f452bc2804419bb14b818613351cd963663bf8f191138e481662f5ca8850d8045d46985a8b412753aae7179bc9fc1c91f57ed414af59e97561db6eec00e1deb
|
7
|
+
data.tar.gz: 1cf7d74de6ecebef12d73c6e257db1e4fc76d3a4d5c1b115b22f5bda22d549dd9144f2a81816fcc6e045fb0843d6234496118ca3885a9a84f94a24efac1b0057
|
data/README.md
CHANGED
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
|
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
|
-
|
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:
|
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