Skip to content

Commit

Permalink
Remove Config from client initialize (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp authored Sep 15, 2023
1 parent a8d84f2 commit 049dd7b
Show file tree
Hide file tree
Showing 61 changed files with 1,066 additions and 1,009 deletions.
13 changes: 4 additions & 9 deletions benchmark/benchmark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def self.initialize_report_data

report_data['cpu'] = RbConfig::CONFIG['host_cpu']
report_data['os'] = host_os
report_data['execution_env'] = ENV['EXECUTION_ENV'] || 'unknown'
report_data['execution_env'] = ENV['EXECUTION_ENV'] || 'unknown'

report_data['timestamp'] = Time.now.to_i

Expand Down Expand Up @@ -153,11 +153,9 @@ def benchmark_client(report_data)
report_data.merge!(Benchmark.fork_run do |out|
require gem_name
client_klass = Kernel.const_get(client_module_name).const_get(:Client)
config_klass = Kernel.const_get(client_module_name).const_get(:Config)
unless defined?(JRUBY_VERSION)
r = ::MemoryProfiler.report do
config = config_klass.new(stub_responses: true)
client_klass.new(config)
client_klass.new(stub_responses: true)
end
out[:client_mem_retained_kb] = r.total_retained_memsize / 1024.0
out[:client_mem_allocated_kb] = r.total_allocated_memsize / 1024.0
Expand All @@ -173,19 +171,16 @@ def benchmark_operations(report_data)
require gem_name

client_klass = Kernel.const_get(client_module_name).const_get(:Client)
config_klass = Kernel.const_get(client_module_name).const_get(:Config)

report_data[:client_init_ms] = Benchmark.measure_time(300) do
config = config_klass.new(stub_responses: true)
client_klass.new(config)
client_klass.new(stub_responses: true)
end

values = report_data[:client_init_ms]
puts "\t\t#{gem_name} client init avg: #{'%.2f' % (values.sum(0.0) / values.size)} ms"

operation_benchmarks.each do |test_name, test_def|
config = config_klass.new(stub_responses: true)
client = client_klass.new(config)
client = client_klass.new(stub_responses: true)
req = test_def[:setup].call(client)


Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions codegen/projections/high_score_service/spec/protocol_spec.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 049dd7b

Please sign in to comment.