Skip to content

Protobuf serialization in Ruby very expensive #12

@clifton

Description

@clifton

Hey Kyle,

@justinsteffy and I have been hitting performance snags doing 50-100 serializations during the request response cycle. We've identified that most of the time is spent in the beefcake library doing protobuf serialization. Have you had any issues with this?

r = Riemann::Client.new
# => #<Riemann::Client:0x00000001fc3040 @host="127.0.0.1", @port=5555, @timeout=5, @udp=#<Riemann::Client::UDP:0x00000001fc2fc8 @host="127.0.0.1", @port=5555, @max_size=16384, @locket=#<Mutex:0x00000001fcafc0>>, @tcp=#<Riemann::Client::TCP:0x00000001fcaf98 @host="127.0.0.1", @port=5555, @timeout=5, @locket=#<Mutex:0x00000001fcaf70>>>
r << { service: 'testing', metric: 1.0, tags: ['test', 'the', 'client'] }
# => nil
require 'benchmark'
# => true
Benchmark.measure do
  1000.times do
    r << { service: 'testing', metric: 1.0, tags: ['test', 'the', 'client'] }
  end
end
=>   0.120000   0.060000   0.180000 (  0.185700)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions