File: running_1_group_1000_examples.rb

package info (click to toggle)
ruby-rspec 3.9.0c2e2m1s3-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,612 kB
  • sloc: ruby: 67,456; sh: 1,572; makefile: 98
file content (60 lines) | stat: -rw-r--r-- 4,374 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
require_relative "helper"

RSpec.describe "one example group" do
  1000.times do |i|
    example "example #{i}" do
    end
  end
end

benchmark_allocations(burn: 0) do
  RSpec::Core::Runner.run([])
end

__END__

Original allocations:

                                          class_plus                                             count
-----------------------------------------------------------------------------------------------  -----
String                                                                                           35018
Array<Symbol>                                                                                    14030
Array                                                                                            12075
RSpec::Core::Hooks::HookCollection                                                                4000
Time                                                                                              2002
Array<Symbol,Proc>                                                                                2000
RSpec::Core::Hooks::AroundHookCollection                                                          2000
RSpec::Core::Notifications::ExampleNotification                                                   2000
Proc                                                                                              1065
RubyVM::Env                                                                                       1018
Array<Class>                                                                                      1006
Array<RSpec::Core::Example>                                                                       1005
RSpec::ExampleGroups::OneExampleGroup                                                             1002
Array<String>                                                                                       67
RubyVM::InstructionSequence                                                                         41
Hash                                                                                                35
Set                                                                                                 30
File                                                                                                 6

After my change:

                                          class_plus                                             count
-----------------------------------------------------------------------------------------------  -----
Array<Symbol>                                                                                    14030
String                                                                                           12967
Array                                                                                            12075
RSpec::Core::Hooks::HookCollection                                                                4000
Time                                                                                              2002
RSpec::Core::Notifications::ExampleNotification                                                   2000
Array<Symbol,Proc>                                                                                2000
RSpec::Core::Hooks::AroundHookCollection                                                          2000
Proc                                                                                              1065
RubyVM::Env                                                                                       1018
Array<Class>                                                                                      1006
Array<RSpec::Core::Example>                                                                       1005
RSpec::ExampleGroups::OneExampleGroup                                                             1002
Array<String>                                                                                       67
RubyVM::InstructionSequence                                                                         41
Hash                                                                                                35
Set                                                                                                 30
File                                                                                                 6