# Why the Sorbet typechecker is fast

DevFeed: [Why the Sorbet typechecker is fast](<https://devfeed.tech/articles/why-the-sorbet-typechecker-is-fast-21977.md>)

Original publisher: [Read original article](<https://blog.nelhage.com/post/why-sorbet-is-fast/>)

Author: Nelson Elhage

Published: 2020-01-24T01:00:00Z

Content type: article

Language: en

Sources: [Nelson Elhage](<https://devfeed.tech/sources/nelson-elhage.md>)

Topics: [Ruby](<https://devfeed.tech/topics/ruby.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>), [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [cpu](<https://devfeed.tech/topics/cpu.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [performance](<https://devfeed.tech/tags/performance.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [software-design](<https://devfeed.tech/tags/software-design.md>)

## AI overview

This article explains why the Sorbet Ruby typechecker is fast. It attributes the performance to C++, native-code compilation, explicit data-structure and allocation control, and designs that improve CPU cache locality. Informal benchmarks on Stripe's codebase measured about 100,000 lines of code typechecked per second per core.

## Source excerpt

This is the second in an indefinite series of posts about things that I think went well in the Sorbet project. The previous one covered our testing approach. Sorbet is fast. Numerous of our early users commented specifically on how fast it was, and how much they appreciated this speed. Our informal benchmarks on Stripe's codebase clocked it as typechecking around 100,000 lines of code per second per core, making it one of the fastest production typecheckers we are aware of.