# Optimizing ruby-protobuf deserialization by 50%

DevFeed: [Optimizing ruby-protobuf deserialization by 50%](<https://devfeed.tech/articles/optimizing-ruby-protobuf-deserialization-by-50-15795.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/optimizing-ruby-protobuf-deserialization-by-50>)

Author: Square Engineering

Published: 2015-11-23T17:10:00Z

Content type: tutorial

Language: en

Sources: [Square Corner Blog RSS Feed](<https://devfeed.tech/sources/square-corner-blog-rss-feed.md>)

Topics: [Ruby](<https://devfeed.tech/topics/ruby.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [ruby](<https://devfeed.tech/tags/ruby.md>)

## AI overview

A practical guide to using ruby-prof to identify performance hotspots in Ruby protobuf deserialization. The article traces slow calls in Protobuf::Enum and Protobuf::Decoder, then describes caching enum data as an optimization that changes a lookup from O(n) to O(1).

## Source excerpt

How to use ruby-prof to find hotspots in code