# Inline Classes and Autoboxing

DevFeed: [Inline Classes and Autoboxing](<https://devfeed.tech/articles/inline-classes-and-autoboxing-25036.md>)

Original publisher: [Read original article](<https://typealias.com/guides/inline-classes-and-autoboxing/>)

Author: author@typealias.com (Dave Leeds)

Published: 2018-10-10T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Benchmark](<https://devfeed.tech/topics/benchmark.md>), [multiplatform](<https://devfeed.tech/topics/multiplatform.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [benchmark](<https://devfeed.tech/tags/benchmark.md>), [code](<https://devfeed.tech/tags/code.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [performance](<https://devfeed.tech/tags/performance.md>), [programming](<https://devfeed.tech/tags/programming.md>)

## AI overview

This tutorial explains how Kotlin inline classes behave in compiled JVM code, focusing on autoboxing and the situations in which inline class instances are not actually inlined. It shows that performance depends on how inline classes are used and can sometimes be worse than with traditional classes.

## Source excerpt

In the last article, we discovered how Kotlin's inline classes feature allows us to "create the data types that we want without giving up the performance that we need." We learned that: Inline classes wrap an underlying value. When the code is compiled, instances of the inline class get replaced with the underlying value. This can improve our app's performance, especially when the underlying type is a primitive. In some situations, though, inline classes could actually perform more slowly than traditional classes!