sorbet-schema 0.9.1 → 0.9.3

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.
@@ -0,0 +1,981 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `benchmark-ips` gem.
5
+ # Please instead update this file by running `bin/tapioca gem benchmark-ips`.
6
+
7
+
8
+ # Performance benchmarking library
9
+ #
10
+ # source://benchmark-ips//lib/benchmark/timing.rb#1
11
+ module Benchmark
12
+ extend ::Benchmark::Compare
13
+ extend ::Benchmark::IPS
14
+ end
15
+
16
+ # Functionality of performaing comparison between reports.
17
+ #
18
+ # Usage:
19
+ #
20
+ # Add +x.compare!+ to perform comparison between reports.
21
+ #
22
+ # Example:
23
+ # > Benchmark.ips do |x|
24
+ # x.report('Reduce using tag') { [*1..10].reduce(:+) }
25
+ # x.report('Reduce using to_proc') { [*1..10].reduce(&:+) }
26
+ # x.compare!
27
+ # end
28
+ #
29
+ # Calculating -------------------------------------
30
+ # Reduce using tag 19216 i/100ms
31
+ # Reduce using to_proc 17437 i/100ms
32
+ # -------------------------------------------------
33
+ # Reduce using tag 278950.0 (±8.5%) i/s - 1402768 in 5.065112s
34
+ # Reduce using to_proc 247295.4 (±8.0%) i/s - 1238027 in 5.037299s
35
+ #
36
+ # Comparison:
37
+ # Reduce using tag: 278950.0 i/s
38
+ # Reduce using to_proc: 247295.4 i/s - 1.13x slower
39
+ #
40
+ # Besides regular Calculating report, this will also indicates which one is slower.
41
+ #
42
+ # +x.compare!+ also takes an +order: :baseline+ option.
43
+ #
44
+ # Example:
45
+ # > Benchmark.ips do |x|
46
+ # x.report('Reduce using block') { [*1..10].reduce { |sum, n| sum + n } }
47
+ # x.report('Reduce using tag') { [*1..10].reduce(:+) }
48
+ # x.report('Reduce using to_proc') { [*1..10].reduce(&:+) }
49
+ # x.compare!(order: :baseline)
50
+ # end
51
+ #
52
+ # Calculating -------------------------------------
53
+ # Reduce using block 886.202k (± 2.2%) i/s - 4.521M in 5.103774s
54
+ # Reduce using tag 1.821M (± 1.6%) i/s - 9.111M in 5.004183s
55
+ # Reduce using to_proc 895.948k (± 1.6%) i/s - 4.528M in 5.055368s
56
+ #
57
+ # Comparison:
58
+ # Reduce using block: 886202.5 i/s
59
+ # Reduce using tag: 1821055.0 i/s - 2.05x (± 0.00) faster
60
+ # Reduce using to_proc: 895948.1 i/s - same-ish: difference falls within error
61
+ #
62
+ # The first report is considered the baseline against which other reports are compared.
63
+ #
64
+ # source://benchmark-ips//lib/benchmark/compare.rb#51
65
+ module Benchmark::Compare
66
+ # Compare between reports, prints out facts of each report:
67
+ # runtime, comparative speed difference.
68
+ #
69
+ # @param entries [Array<Report::Entry>] Reports to compare.
70
+ #
71
+ # source://benchmark-ips//lib/benchmark/compare.rb#56
72
+ def compare(*entries, order: T.unsafe(nil)); end
73
+ end
74
+
75
+ # Benchmark in iterations per second, no more guessing!
76
+ #
77
+ # See Benchmark.ips for documentation on using this gem~
78
+ #
79
+ # @see {https://github.com/evanphx/benchmark-ips}
80
+ #
81
+ # source://benchmark-ips//lib/benchmark/ips/stats/stats_metric.rb#2
82
+ module Benchmark::IPS
83
+ # Measure code in block, each code's benchmarked result will display in
84
+ # iteration per second with standard deviation in given time.
85
+ #
86
+ # @param time [Integer] Specify how long should benchmark your code in seconds.
87
+ # @param warmup [Integer] Specify how long should Warmup time run in seconds.
88
+ # @return [Report]
89
+ # @yield [job]
90
+ #
91
+ # source://benchmark-ips//lib/benchmark/ips.rb#33
92
+ def ips(*args); end
93
+
94
+ # Quickly compare multiple methods on the same object.
95
+ #
96
+ # @example Compare String#upcase and String#downcase
97
+ # ips_quick(:upcase, :downcase, on: "hello")
98
+ # @example Compare two methods you just defined, with a custom warmup.
99
+ # def add; 1+1; end
100
+ # def sub; 2-1; end
101
+ # ips_quick(:add, :sub, warmup: 10)
102
+ # @option opts
103
+ # @option opts
104
+ # @param methods [Symbol...] A list of method names (as symbols) to compare.
105
+ # @param receiver [Object] The object on which to call the methods. Defaults to Kernel.
106
+ # @param opts [Hash] Additional options for customizing the benchmark.
107
+ #
108
+ # source://benchmark-ips//lib/benchmark/ips.rb#93
109
+ def ips_quick(*methods, on: T.unsafe(nil), **opts); end
110
+
111
+ class << self
112
+ # Set options for running the benchmarks.
113
+ # :format => [:human, :raw]
114
+ # :human format narrows precision and scales results for readability
115
+ # :raw format displays 6 places of precision and exact iteration counts
116
+ #
117
+ # source://benchmark-ips//lib/benchmark/ips.rb#109
118
+ def options; end
119
+ end
120
+ end
121
+
122
+ # CODENAME of current version.
123
+ #
124
+ # source://benchmark-ips//lib/benchmark/ips.rb#26
125
+ Benchmark::IPS::CODENAME = T.let(T.unsafe(nil), String)
126
+
127
+ # source://benchmark-ips//lib/benchmark/ips.rb#113
128
+ module Benchmark::IPS::Helpers
129
+ private
130
+
131
+ # source://benchmark-ips//lib/benchmark/ips.rb#126
132
+ def humanize_duration(duration_ns); end
133
+
134
+ # source://benchmark-ips//lib/benchmark/ips.rb#116
135
+ def scale(value); end
136
+
137
+ class << self
138
+ # source://benchmark-ips//lib/benchmark/ips.rb#126
139
+ def humanize_duration(duration_ns); end
140
+
141
+ # source://benchmark-ips//lib/benchmark/ips.rb#116
142
+ def scale(value); end
143
+ end
144
+ end
145
+
146
+ # source://benchmark-ips//lib/benchmark/ips.rb#114
147
+ Benchmark::IPS::Helpers::SUFFIXES = T.let(T.unsafe(nil), Array)
148
+
149
+ # Benchmark jobs.
150
+ #
151
+ # source://benchmark-ips//lib/benchmark/ips/job/entry.rb#4
152
+ class Benchmark::IPS::Job
153
+ # Instantiate the Benchmark::IPS::Job.
154
+ #
155
+ # @return [Job] a new instance of Job
156
+ #
157
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#67
158
+ def initialize(opts = T.unsafe(nil)); end
159
+
160
+ # @return [Boolean]
161
+ #
162
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#241
163
+ def all_results_have_been_run?; end
164
+
165
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#245
166
+ def clear_held_results; end
167
+
168
+ # Determining whether to run comparison utility.
169
+ #
170
+ # @return [Boolean] true if needs to run compare.
171
+ #
172
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#20
173
+ def compare; end
174
+
175
+ # Run comparison utility.
176
+ #
177
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#124
178
+ def compare!(order: T.unsafe(nil)); end
179
+
180
+ # Return true if job needs to be compared.
181
+ #
182
+ # @return [Boolean] Need to compare?
183
+ #
184
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#119
185
+ def compare?; end
186
+
187
+ # Confidence.
188
+ #
189
+ # @return [Integer]
190
+ #
191
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#52
192
+ def confidence; end
193
+
194
+ # Confidence.
195
+ #
196
+ # @return [Integer]
197
+ #
198
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#52
199
+ def confidence=(_arg0); end
200
+
201
+ # Job configuration options, set +@warmup+ and +@time+.
202
+ #
203
+ # @option opts
204
+ # @option opts
205
+ # @option iterations
206
+ # @param opts [Hash] a customizable set of options
207
+ # @param iterations [Hash] a customizable set of options
208
+ #
209
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#95
210
+ def config(opts); end
211
+
212
+ # Create report by add entry to +@full_report+.
213
+ #
214
+ # @param label [String] Report item label.
215
+ # @param measured_us [Integer] Measured time in microsecond.
216
+ # @param iter [Integer] Iterations.
217
+ # @param samples [Array<Float>] Sampled iterations per second.
218
+ # @param cycles [Integer] Number of Cycles.
219
+ # @return [Report::Entry] Entry with data.
220
+ #
221
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#392
222
+ def create_report(label, measured_us, iter, samples, cycles); end
223
+
224
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#364
225
+ def create_stats(samples); end
226
+
227
+ # Calculate the cycles needed to run for approx 100ms,
228
+ # given the number of iterations to run the given time.
229
+ #
230
+ # @param time_msec [Float] Each iteration's time in ms.
231
+ # @param iters [Integer] Iterations.
232
+ # @return [Integer] Cycles per 100ms.
233
+ #
234
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#193
235
+ def cycles_per_100ms(time_msec, iters); end
236
+
237
+ # Report object containing information about the run.
238
+ #
239
+ # @return [Report] the report object.
240
+ #
241
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#28
242
+ def full_report; end
243
+
244
+ # Generate json from +@full_report+.
245
+ #
246
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#381
247
+ def generate_json; end
248
+
249
+ # Determining whether to hold results between Ruby invocations
250
+ #
251
+ # @return [Boolean]
252
+ #
253
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#24
254
+ def hold; end
255
+
256
+ # Hold after each iteration.
257
+ #
258
+ # @param held_path [String] File name to store hold file.
259
+ #
260
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#137
261
+ def hold!(held_path); end
262
+
263
+ # Determining whether to hold results between Ruby invocations
264
+ #
265
+ # @return [Boolean]
266
+ #
267
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#24
268
+ def hold=(_arg0); end
269
+
270
+ # Return true if results are held while multiple Ruby invocations
271
+ #
272
+ # @return [Boolean] Need to hold results between multiple Ruby invocations?
273
+ #
274
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#131
275
+ def hold?; end
276
+
277
+ # Registers the given label and block pair in the job list.
278
+ #
279
+ # @param label [String] Label of benchmarked code.
280
+ # @param str [String] Code to be benchmarked.
281
+ # @param blk [Proc] Code to be benchmarked.
282
+ # @raise [ArgumentError] Raises if str and blk are both present.
283
+ # @raise [ArgumentError] Raises if str and blk are both absent.
284
+ #
285
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#175
286
+ def item(label = T.unsafe(nil), str = T.unsafe(nil), &blk); end
287
+
288
+ # Warmup and calculation iterations.
289
+ #
290
+ # @return [Integer]
291
+ #
292
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#44
293
+ def iterations; end
294
+
295
+ # Warmup and calculation iterations.
296
+ #
297
+ # @return [Integer]
298
+ #
299
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#44
300
+ def iterations=(_arg0); end
301
+
302
+ # Calculate the iterations per second given the number
303
+ # of cycles run and the time in microseconds that elapsed.
304
+ #
305
+ # @param cycles [Integer] Cycles.
306
+ # @param time_us [Integer] Time in microsecond.
307
+ # @return [Float] Iteration per second.
308
+ #
309
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#211
310
+ def iterations_per_sec(cycles, time_us); end
311
+
312
+ # Generate json to given path, defaults to "data.json".
313
+ #
314
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#165
315
+ def json!(path = T.unsafe(nil)); end
316
+
317
+ # Return true if job needs to generate json.
318
+ #
319
+ # @return [Boolean] Need to generate json?
320
+ #
321
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#160
322
+ def json?; end
323
+
324
+ # Two-element arrays, consisting of label and block pairs.
325
+ #
326
+ # @return [Array<Entry>] list of entries
327
+ #
328
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#16
329
+ def list; end
330
+
331
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#215
332
+ def load_held_results; end
333
+
334
+ # Silence output
335
+ #
336
+ # @return [Boolean]
337
+ #
338
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#56
339
+ def quiet; end
340
+
341
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#105
342
+ def quiet=(val); end
343
+
344
+ # Registers the given label and block pair in the job list.
345
+ #
346
+ # @param label [String] Label of benchmarked code.
347
+ # @param str [String] Code to be benchmarked.
348
+ # @param blk [Proc] Code to be benchmarked.
349
+ # @raise [ArgumentError] Raises if str and blk are both present.
350
+ # @raise [ArgumentError] Raises if str and blk are both absent.
351
+ #
352
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#175
353
+ def report(label = T.unsafe(nil), str = T.unsafe(nil), &blk); end
354
+
355
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#249
356
+ def run; end
357
+
358
+ # Run calculation.
359
+ #
360
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#312
361
+ def run_benchmark; end
362
+
363
+ # Run comparison of entries in +@full_report+.
364
+ #
365
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#376
366
+ def run_comparison; end
367
+
368
+ # Return true if items are to be run one at a time.
369
+ # For the traditional hold, this is true
370
+ #
371
+ # @return [Boolean] Run just a single item?
372
+ #
373
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#154
374
+ def run_single?; end
375
+
376
+ # Run warmup.
377
+ #
378
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#267
379
+ def run_warmup; end
380
+
381
+ # Save interim results. Similar to hold, but all reports are run
382
+ # The report label must change for each invocation.
383
+ # One way to achieve this is to include the version in the label.
384
+ #
385
+ # @param held_path [String] File name to store hold file.
386
+ #
387
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#146
388
+ def save!(held_path); end
389
+
390
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#226
391
+ def save_held_results; end
392
+
393
+ # Statistics model.
394
+ #
395
+ # @return [Object]
396
+ #
397
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#48
398
+ def stats; end
399
+
400
+ # Statistics model.
401
+ #
402
+ # @return [Object]
403
+ #
404
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#48
405
+ def stats=(_arg0); end
406
+
407
+ # Suite
408
+ #
409
+ # @return [Benchmark::IPS::MultiReport]
410
+ #
411
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#62
412
+ def suite; end
413
+
414
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#113
415
+ def suite=(suite); end
416
+
417
+ # Calculation time setter and getter (in seconds).
418
+ #
419
+ # @return [Integer]
420
+ #
421
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#40
422
+ def time; end
423
+
424
+ # Calculation time setter and getter (in seconds).
425
+ #
426
+ # @return [Integer]
427
+ #
428
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#40
429
+ def time=(_arg0); end
430
+
431
+ # Calculate the time difference of before and after in microseconds.
432
+ #
433
+ # @param before [Time] time.
434
+ # @param after [Time] time.
435
+ # @return [Float] Time difference of before and after.
436
+ #
437
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#202
438
+ def time_us(before, after); end
439
+
440
+ # Storing Iterations in time period.
441
+ #
442
+ # @return [Hash]
443
+ #
444
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#32
445
+ def timing; end
446
+
447
+ # Warmup time setter and getter (in seconds).
448
+ #
449
+ # @return [Integer]
450
+ #
451
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#36
452
+ def warmup; end
453
+
454
+ # Warmup time setter and getter (in seconds).
455
+ #
456
+ # @return [Integer]
457
+ #
458
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#36
459
+ def warmup=(_arg0); end
460
+ end
461
+
462
+ # Entries in Benchmark Jobs.
463
+ #
464
+ # source://benchmark-ips//lib/benchmark/ips/job/entry.rb#6
465
+ class Benchmark::IPS::Job::Entry
466
+ # Instantiate the Benchmark::IPS::Job::Entry.
467
+ #
468
+ # @param label [#to_s] Label of Benchmarked code.
469
+ # @param action [String, Proc] Code to be benchmarked.
470
+ # @raise [ArgumentError] Raises when action is not String or not responding to +call+.
471
+ # @return [Entry] a new instance of Entry
472
+ #
473
+ # source://benchmark-ips//lib/benchmark/ips/job/entry.rb#11
474
+ def initialize(label, action); end
475
+
476
+ # The benchmarking action.
477
+ #
478
+ # @return [String, Proc] Code to be called, could be String / Proc.
479
+ #
480
+ # source://benchmark-ips//lib/benchmark/ips/job/entry.rb#41
481
+ def action; end
482
+
483
+ # Call action by given times.
484
+ #
485
+ # @param times [Integer] Times to call +@action+.
486
+ # @return [Integer] Number of times the +@action+ has been called.
487
+ #
488
+ # source://benchmark-ips//lib/benchmark/ips/job/entry.rb#46
489
+ def call_times(times); end
490
+
491
+ # source://benchmark-ips//lib/benchmark/ips/job/entry.rb#50
492
+ def compile_block; end
493
+
494
+ # source://benchmark-ips//lib/benchmark/ips/job/entry.rb#66
495
+ def compile_block_with_manual_loop; end
496
+
497
+ # Compile code into +call_times+ method.
498
+ #
499
+ # @param str [String] Code to be compiled.
500
+ # @return [Symbol] :call_times.
501
+ #
502
+ # source://benchmark-ips//lib/benchmark/ips/job/entry.rb#79
503
+ def compile_string(str); end
504
+
505
+ # The label of benchmarking action.
506
+ #
507
+ # @return [#to_s] Label of action.
508
+ #
509
+ # source://benchmark-ips//lib/benchmark/ips/job/entry.rb#37
510
+ def label; end
511
+ end
512
+
513
+ # The percentage of the expected runtime to allow
514
+ # before reporting a weird runtime
515
+ #
516
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#11
517
+ Benchmark::IPS::Job::MAX_TIME_SKEW = T.let(T.unsafe(nil), Float)
518
+
519
+ # Microseconds per 100 millisecond.
520
+ #
521
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#6
522
+ Benchmark::IPS::Job::MICROSECONDS_PER_100MS = T.let(T.unsafe(nil), Integer)
523
+
524
+ # Microseconds per second.
525
+ #
526
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#8
527
+ Benchmark::IPS::Job::MICROSECONDS_PER_SECOND = T.let(T.unsafe(nil), Integer)
528
+
529
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#4
530
+ class Benchmark::IPS::Job::MultiReport
531
+ # @param out [Array<StreamReport>] list of reports to send output
532
+ # @return [MultiReport] a new instance of MultiReport
533
+ #
534
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#32
535
+ def initialize(out = T.unsafe(nil)); end
536
+
537
+ # @param report [StreamReport] report to accept input?
538
+ #
539
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#21
540
+ def <<(report); end
541
+
542
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#57
543
+ def add_report(item, caller); end
544
+
545
+ # @return [Boolean]
546
+ #
547
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#8
548
+ def empty?; end
549
+
550
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#61
551
+ def footer; end
552
+
553
+ # Returns the value of attribute out.
554
+ #
555
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#6
556
+ def out; end
557
+
558
+ # Sets the attribute out
559
+ #
560
+ # @param value the value to set the attribute out to.
561
+ #
562
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#6
563
+ def out=(_arg0); end
564
+
565
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#16
566
+ def quiet!; end
567
+
568
+ # @return [Boolean]
569
+ #
570
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#12
571
+ def quiet?; end
572
+
573
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#53
574
+ def running(label, warmup); end
575
+
576
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#49
577
+ def start_running; end
578
+
579
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#37
580
+ def start_warming; end
581
+
582
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#41
583
+ def warming(label, warmup); end
584
+
585
+ # source://benchmark-ips//lib/benchmark/ips/job/multi_report.rb#45
586
+ def warmup_stats(warmup_time_us, timing); end
587
+ end
588
+
589
+ # source://benchmark-ips//lib/benchmark/ips/job.rb#12
590
+ Benchmark::IPS::Job::POW_2_30 = T.let(T.unsafe(nil), Integer)
591
+
592
+ # source://benchmark-ips//lib/benchmark/ips/job/stream_report.rb#4
593
+ class Benchmark::IPS::Job::StreamReport
594
+ # @return [StreamReport] a new instance of StreamReport
595
+ #
596
+ # source://benchmark-ips//lib/benchmark/ips/job/stream_report.rb#5
597
+ def initialize(stream = T.unsafe(nil)); end
598
+
599
+ # source://benchmark-ips//lib/benchmark/ips/job/stream_report.rb#34
600
+ def add_report(item, caller); end
601
+
602
+ # source://benchmark-ips//lib/benchmark/ips/job/stream_report.rb#39
603
+ def footer; end
604
+
605
+ # source://benchmark-ips//lib/benchmark/ips/job/stream_report.rb#19
606
+ def running(label, _warmup); end
607
+
608
+ # source://benchmark-ips//lib/benchmark/ips/job/stream_report.rb#15
609
+ def start_running; end
610
+
611
+ # source://benchmark-ips//lib/benchmark/ips/job/stream_report.rb#10
612
+ def start_warming; end
613
+
614
+ # source://benchmark-ips//lib/benchmark/ips/job/stream_report.rb#19
615
+ def warming(label, _warmup); end
616
+
617
+ # source://benchmark-ips//lib/benchmark/ips/job/stream_report.rb#23
618
+ def warmup_stats(_warmup_time_us, timing); end
619
+
620
+ private
621
+
622
+ # @return [Symbol] format used for benchmarking
623
+ #
624
+ # source://benchmark-ips//lib/benchmark/ips/job/stream_report.rb#48
625
+ def format; end
626
+
627
+ # Add padding to label's right if label's length < 20,
628
+ # Otherwise add a new line and 20 whitespaces.
629
+ #
630
+ # @return [String] Right justified label.
631
+ #
632
+ # source://benchmark-ips//lib/benchmark/ips/job/stream_report.rb#55
633
+ def rjust(label); end
634
+ end
635
+
636
+ # Report contains benchmarking entries.
637
+ # Perform operations like add new entry, run comparison between entries.
638
+ #
639
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#8
640
+ class Benchmark::IPS::Report
641
+ # Instantiate the Report.
642
+ #
643
+ # @return [Report] a new instance of Report
644
+ #
645
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#137
646
+ def initialize; end
647
+
648
+ # Add entry to report.
649
+ #
650
+ # @param label [String] Entry label.
651
+ # @param microseconds [Integer] Measured time in microsecond.
652
+ # @param iters [Integer] Iterations.
653
+ # @param stats [Object] Statistical results.
654
+ # @param measurement_cycle [Integer] Number of cycles.
655
+ # @return [Report::Entry] Last added entry.
656
+ #
657
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#149
658
+ def add_entry(label, microseconds, iters, stats, measurement_cycle); end
659
+
660
+ # Entries data in array for generate json.
661
+ # Each entry is a hash, consists of:
662
+ # name: Entry#label
663
+ # ips: Entry#ips
664
+ # stddev: Entry#ips_sd
665
+ # microseconds: Entry#microseconds
666
+ # iterations: Entry#iterations
667
+ # cycles: Entry#measurement_cycles
668
+ #
669
+ # @return [Array<Hash<Symbol,String|Float|Integer>] Array of hashes] Array<Hash<Symbol,String|Float|Integer>] Array of hashes
670
+ #
671
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#165
672
+ def data; end
673
+
674
+ # Entry to represent each benchmarked code in Report.
675
+ #
676
+ # @return [Array<Report::Entry>] Entries in Report.
677
+ #
678
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#134
679
+ def entries; end
680
+
681
+ # Generate json from Report#data to given path.
682
+ #
683
+ # @param path [String] path to generate json.
684
+ #
685
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#187
686
+ def generate_json(path); end
687
+
688
+ # Run comparison of entries.
689
+ #
690
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#181
691
+ def run_comparison(order); end
692
+ end
693
+
694
+ # Represents benchmarking code data for Report.
695
+ #
696
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#11
697
+ class Benchmark::IPS::Report::Entry
698
+ # Instantiate the Benchmark::IPS::Report::Entry.
699
+ #
700
+ # @param label [#to_s] Label of entry.
701
+ # @param us [Integer] Measured time in microsecond.
702
+ # @param iters [Integer] Iterations.
703
+ # @param stats [Object] Statistics.
704
+ # @param cycles [Integer] Number of Cycles.
705
+ # @return [Entry] a new instance of Entry
706
+ #
707
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#18
708
+ def initialize(label, us, iters, stats, cycles); end
709
+
710
+ # Return Entry body text with left padding.
711
+ # Body text contains information of iteration per second with
712
+ # percentage of standard deviation, iterations in runtime.
713
+ #
714
+ # @return [String] Left justified body.
715
+ #
716
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#88
717
+ def body; end
718
+
719
+ # Print entry to current standard output ($stdout).
720
+ #
721
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#125
722
+ def display; end
723
+
724
+ # Return entry's standard deviation of iteration per second in percentage.
725
+ #
726
+ # @return [Float] +@ips_sd+ in percentage.
727
+ #
728
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#78
729
+ def error_percentage; end
730
+
731
+ # Return header with padding if +@label+ is < length of 20.
732
+ #
733
+ # @return [String] Right justified header (+@label+).
734
+ #
735
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#114
736
+ def header; end
737
+
738
+ # LEGACY: Iterations per second.
739
+ #
740
+ # @return [Float] number of iterations per second.
741
+ #
742
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#45
743
+ def ips; end
744
+
745
+ # LEGACY: Standard deviation of iteration per second.
746
+ #
747
+ # @return [Float] standard deviation of iteration per second.
748
+ #
749
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#51
750
+ def ips_sd; end
751
+
752
+ # Number of Iterations.
753
+ #
754
+ # @return [Integer] number of iterations.
755
+ #
756
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#37
757
+ def iterations; end
758
+
759
+ # Label of entry.
760
+ #
761
+ # @return [String] the label of entry.
762
+ #
763
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#29
764
+ def label; end
765
+
766
+ # Number of Cycles.
767
+ #
768
+ # @return [Integer] number of cycles.
769
+ #
770
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#61
771
+ def measurement_cycle; end
772
+
773
+ # Measured time in microsecond.
774
+ #
775
+ # @return [Integer] number of microseconds.
776
+ #
777
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#33
778
+ def microseconds; end
779
+
780
+ # Return entry's microseconds in seconds.
781
+ #
782
+ # @return [Float] +@microseconds+ in seconds.
783
+ #
784
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#72
785
+ def runtime; end
786
+
787
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#55
788
+ def samples; end
789
+
790
+ # Return entry's microseconds in seconds.
791
+ #
792
+ # @return [Float] +@microseconds+ in seconds.
793
+ #
794
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#72
795
+ def seconds; end
796
+
797
+ # Control if the total time the job took is reported.
798
+ # Typically this value is not significant because it's very
799
+ # close to the expected time, so it's suppressed by default.
800
+ #
801
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#66
802
+ def show_total_time!; end
803
+
804
+ # Statistical summary of samples.
805
+ #
806
+ # @return [Object] statisical summary.
807
+ #
808
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#41
809
+ def stats; end
810
+
811
+ # Return string representation of Entry object.
812
+ #
813
+ # @return [String] Header and body.
814
+ #
815
+ # source://benchmark-ips//lib/benchmark/ips/report.rb#120
816
+ def to_s; end
817
+ end
818
+
819
+ # source://benchmark-ips//lib/benchmark/ips/stats/stats_metric.rb#3
820
+ module Benchmark::IPS::Stats; end
821
+
822
+ # source://benchmark-ips//lib/benchmark/ips/stats/bootstrap.rb#5
823
+ class Benchmark::IPS::Stats::Bootstrap
824
+ include ::Benchmark::IPS::Stats::StatsMetric
825
+
826
+ # @return [Bootstrap] a new instance of Bootstrap
827
+ #
828
+ # source://benchmark-ips//lib/benchmark/ips/stats/bootstrap.rb#9
829
+ def initialize(samples, confidence); end
830
+
831
+ # Average stat value
832
+ #
833
+ # @return [Float] central_tendency
834
+ #
835
+ # source://benchmark-ips//lib/benchmark/ips/stats/bootstrap.rb#22
836
+ def central_tendency; end
837
+
838
+ # Returns the value of attribute data.
839
+ #
840
+ # source://benchmark-ips//lib/benchmark/ips/stats/bootstrap.rb#7
841
+ def data; end
842
+
843
+ # source://benchmark-ips//lib/benchmark/ips/stats/bootstrap.rb#44
844
+ def dependencies; end
845
+
846
+ # Returns the value of attribute error.
847
+ #
848
+ # source://benchmark-ips//lib/benchmark/ips/stats/bootstrap.rb#7
849
+ def error; end
850
+
851
+ # source://benchmark-ips//lib/benchmark/ips/stats/bootstrap.rb#40
852
+ def footer; end
853
+
854
+ # Returns the value of attribute samples.
855
+ #
856
+ # source://benchmark-ips//lib/benchmark/ips/stats/bootstrap.rb#7
857
+ def samples; end
858
+
859
+ # Determines how much slower this stat is than the baseline stat
860
+ # if this average is lower than the faster baseline, higher average is better (e.g. ips) (calculate accordingly)
861
+ #
862
+ # @param baseline [SD|Bootstrap] faster baseline
863
+ #
864
+ # source://benchmark-ips//lib/benchmark/ips/stats/bootstrap.rb#30
865
+ def slowdown(baseline); end
866
+
867
+ # source://benchmark-ips//lib/benchmark/ips/stats/bootstrap.rb#36
868
+ def speedup(baseline); end
869
+ end
870
+
871
+ # source://benchmark-ips//lib/benchmark/ips/stats/sd.rb#5
872
+ class Benchmark::IPS::Stats::SD
873
+ include ::Benchmark::IPS::Stats::StatsMetric
874
+
875
+ # @return [SD] a new instance of SD
876
+ #
877
+ # source://benchmark-ips//lib/benchmark/ips/stats/sd.rb#9
878
+ def initialize(samples); end
879
+
880
+ # Average stat value
881
+ #
882
+ # @return [Float] central_tendency
883
+ #
884
+ # source://benchmark-ips//lib/benchmark/ips/stats/sd.rb#17
885
+ def central_tendency; end
886
+
887
+ # Returns the value of attribute error.
888
+ #
889
+ # source://benchmark-ips//lib/benchmark/ips/stats/sd.rb#7
890
+ def error; end
891
+
892
+ # source://benchmark-ips//lib/benchmark/ips/stats/sd.rb#37
893
+ def footer; end
894
+
895
+ # Returns the value of attribute samples.
896
+ #
897
+ # source://benchmark-ips//lib/benchmark/ips/stats/sd.rb#7
898
+ def samples; end
899
+
900
+ # Determines how much slower this stat is than the baseline stat
901
+ # if this average is lower than the faster baseline, higher average is better (e.g. ips) (calculate accordingly)
902
+ #
903
+ # @param baseline [SD|Bootstrap] faster baseline
904
+ #
905
+ # source://benchmark-ips//lib/benchmark/ips/stats/sd.rb#25
906
+ def slowdown(baseline); end
907
+
908
+ # source://benchmark-ips//lib/benchmark/ips/stats/sd.rb#33
909
+ def speedup(baseline); end
910
+ end
911
+
912
+ # source://benchmark-ips//lib/benchmark/ips/stats/stats_metric.rb#4
913
+ module Benchmark::IPS::Stats::StatsMetric
914
+ # Return entry's standard deviation of iteration per second in percentage.
915
+ #
916
+ # @return [Float] +@ips_sd+ in percentage.
917
+ #
918
+ # source://benchmark-ips//lib/benchmark/ips/stats/stats_metric.rb#7
919
+ def error_percentage; end
920
+
921
+ # @return [Boolean]
922
+ #
923
+ # source://benchmark-ips//lib/benchmark/ips/stats/stats_metric.rb#11
924
+ def overlaps?(baseline); end
925
+ end
926
+
927
+ # Benchmark-ips Gem version.
928
+ #
929
+ # source://benchmark-ips//lib/benchmark/ips.rb#23
930
+ Benchmark::IPS::VERSION = T.let(T.unsafe(nil), String)
931
+
932
+ # Perform calculations on Timing results.
933
+ #
934
+ # source://benchmark-ips//lib/benchmark/timing.rb#3
935
+ module Benchmark::Timing
936
+ class << self
937
+ # source://benchmark-ips//lib/benchmark/timing.rb#54
938
+ def add_second(t, s); end
939
+
940
+ # Recycle used objects by starting Garbage Collector.
941
+ #
942
+ # source://benchmark-ips//lib/benchmark/timing.rb#35
943
+ def clean_env; end
944
+
945
+ # Calculate (arithmetic) mean of given samples.
946
+ #
947
+ # @param samples [Array] Samples to calculate mean.
948
+ # @return [Float] Mean of given samples.
949
+ #
950
+ # source://benchmark-ips//lib/benchmark/timing.rb#10
951
+ def mean(samples); end
952
+
953
+ # source://benchmark-ips//lib/benchmark/timing.rb#49
954
+ def now; end
955
+
956
+ # Calculate standard deviation of given samples.
957
+ #
958
+ # @param samples [Array] Samples to calculate standard deviation.
959
+ # @param m [Float] Optional mean (Expected value).
960
+ # @return [Float] standard deviation of given samples.
961
+ #
962
+ # source://benchmark-ips//lib/benchmark/timing.rb#30
963
+ def stddev(samples, m = T.unsafe(nil)); end
964
+
965
+ # source://benchmark-ips//lib/benchmark/timing.rb#59
966
+ def time_us(before, after); end
967
+
968
+ # Calculate variance of given samples.
969
+ #
970
+ # @param m [Float] Optional mean (Expected value).
971
+ # @return [Float] Variance of given samples.
972
+ #
973
+ # source://benchmark-ips//lib/benchmark/timing.rb#18
974
+ def variance(samples, m = T.unsafe(nil)); end
975
+ end
976
+ end
977
+
978
+ # Microseconds per second.
979
+ #
980
+ # source://benchmark-ips//lib/benchmark/timing.rb#5
981
+ Benchmark::Timing::MICROSECONDS_PER_SECOND = T.let(T.unsafe(nil), Integer)