We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0bd2158 commit e20641bCopy full SHA for e20641b
benchmarks/graphql/benchmark.rb
@@ -5,10 +5,21 @@
5
6
require "graphql"
7
8
-data = File.read "negotiate.gql"
+DATA = Ractor.make_shareable(File.read "negotiate.gql")
9
+
10
+if ENV["YJIT_BENCH_RACTOR_HARNESS"]
11
+ GraphQL.default_parser
12
+ Ractor.make_shareable(GraphQL::Tracing::NullTrace)
13
+ GraphQL::Language::Lexer.constants.each do |constant|
14
+ Ractor.make_shareable(GraphQL::Language::Lexer.const_get(constant))
15
+ end
16
+ GraphQL::Language::Parser.constants.each do |constant|
17
+ Ractor.make_shareable(GraphQL::Language::Parser.const_get(constant))
18
19
+end
20
21
run_benchmark(10) do
22
10.times do |i|
- GraphQL.parse data
23
+ GraphQL.parse DATA
24
end
25
0 commit comments