Skip to content

Commit 44b4978

Browse files
committed
Update benchmark to use input objects and measure retained memory
1 parent ab131bd commit 44b4978

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

benchmark/run.rb

+7-2
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,16 @@ def self.build_large_schema
110110
end
111111

112112
obj_ts = 100.times.map do |n|
113+
input_obj_t = Class.new(GraphQL::Schema::InputObject) do
114+
graphql_name("Input#{n}")
115+
argument :arg, String
116+
end
113117
obj_t = Class.new(GraphQL::Schema::Object) do
114118
graphql_name("Object#{n}")
115119
implements(*int_ts)
116120
20.times do |n2|
117121
field :"field#{n2}", String do
118-
argument :arg, String
122+
argument :input, input_obj_t
119123
end
120124

121125
end
@@ -152,8 +156,9 @@ def self.profile_boot
152156
end
153157
StackProf::Report.new(result).print_text
154158

159+
retained_schema = nil
155160
report = MemoryProfiler.report do
156-
build_large_schema
161+
retained_schema = build_large_schema
157162
end
158163

159164
report.pretty_print

0 commit comments

Comments
 (0)