File: profile_large_string.rb

package info (click to toggle)
ruby-redis-client 0.28.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,116 kB
  • sloc: ansic: 7,517; ruby: 5,801; makefile: 246; sh: 123
file content (14 lines) | stat: -rw-r--r-- 405 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

require_relative "setup"
require "stackprof"

driver = ENV.fetch("DRIVER", "ruby").to_sym
redis_client = RedisClient.new(host: "localhost", port: Servers::REDIS.real_port, driver: driver)
redis_client.call("SET", "large", "value" * 10_000)

StackProf.run(out: "tmp/stackprof-large-string.dump", raw: true) do
  1_000.times do
    redis_client.call("GET", "large")
  end
end