# How Field Names Affect Performance in Android ART

DevFeed: [How Field Names Affect Performance in Android ART](<https://devfeed.tech/articles/naming-is-hard-25602.md>)

Original publisher: [Read original article](<https://www.romainguy.dev/posts/2024/naming-is-hard/>)

Author: Romain Guy

Published: 2024-12-19T00:00:00Z

Content type: tutorial

Language: en

Sources: [Posts on Romain Guy](<https://devfeed.tech/sources/posts-on-romain-guy.md>)

Topics: [LineageOS](<https://devfeed.tech/topics/lineageos.md>), [Code](<https://devfeed.tech/topics/code.md>), [Caching](<https://devfeed.tech/topics/caching.md>), [Benchmark](<https://devfeed.tech/topics/benchmark.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [cache](<https://devfeed.tech/tags/cache.md>), [code](<https://devfeed.tech/tags/code.md>), [developer](<https://devfeed.tech/tags/developer.md>), [graphics](<https://devfeed.tech/tags/graphics.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [performance](<https://devfeed.tech/tags/performance.md>)

## AI overview

This article explains how field naming can affect object field layout and memory-access performance in Android's Android Runtime (ART). In the supplied benchmark, renaming a field made the code 40% faster, because the fields were placed at different memory offsets and could trigger an L1 cache miss.

## Source excerpt

Before we dive into today's topic, I would like to make it clear that what follows is specific to how Android, and more precisely the Android RunTime (ART), works. Some of what follows applies to other environments as well, but the main twist is about Android. If you have read my previous articles, you should know by now that seemingly small or irrelevant changes can have a large impact on performance. So let's look at another one! We'll start our journey with a class containing a bunch of fields. What they are and what they mean isn't really relevant for now, let's just imagine we are dealing with a fairly large object1: