# Kotlin-android-synthetics performance analysis (with ButterKnife)

DevFeed: [Kotlin-android-synthetics performance analysis (with ButterKnife)](<https://devfeed.tech/articles/kotlin-android-synthetics-performance-analysis-with-butterknife-38609.md>)

Original publisher: [Read original article](<https://krossovochkin.com/posts/2019_02_18_kotlin_android_synthetics_performance_analysis_with_butterknife/>)

Published: 2019-02-18T00:00:00Z

Content type: article

Language: en

Sources: [Vasya Drobushkov](<https://devfeed.tech/sources/vasya-drobushkov.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Code generation](<https://devfeed.tech/topics/code-generation.md>), [Android](<https://devfeed.tech/topics/android.md>), [R8](<https://devfeed.tech/topics/r8.md>), [class](<https://devfeed.tech/topics/class.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [proguard](<https://devfeed.tech/tags/proguard.md>), [r8](<https://devfeed.tech/tags/r8.md>)

## AI overview

An analysis of Kotlin Android synthetics examines generated Java and bytecode, comparing the approach with vanilla findViewById and ButterKnife. It discusses generated cache code, lateinit null checks, HashMap boxing overhead, and how ProGuard or R8 can remove or optimize unused code in release builds.

## Source excerpt

Introduction After comment that synthetic is no longer recommended practice and some arguments I decided to go deeper into issue with performance of kotlin-android-synthetics by analyzing generated Java and byte code and comparing to other approaches (such as vanilla-*findViewById *and ButterKnife). Vanilla-findViewById This is sample Activity we'll work with throughout the article. Approach with *findViewById *will be our baseline. Sample consists of: *Activity *class One *TextView *property inside *Activity *with *lateinit *modifier