File: profile_large_list.rb

package info (click to toggle)
ruby-redis-client 0.28.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,116 kB
  • sloc: ansic: 7,517; ruby: 5,801; makefile: 246; sh: 123
file content (14 lines) | stat: -rw-r--r-- 413 bytes parent folder | download | duplicates (2)
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("LPUSH", "list", *1000.times.to_a)

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