Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

does variable name length matter for android application performance? [duplicate]

Tags:

java

android

In Android application programming, does variable name length really matter? Do long variable names affect performance of an android application?

like image 270
Vadiraj Purohit Avatar asked Feb 07 '23 09:02

Vadiraj Purohit


2 Answers

As far as I know the Compiler for Android doesn't care about your variable names. If you decompile (or reverse engineer) the code, you sometimes get single letter variable names which means the compiler rewrites your variable names.
But anyway the compiler doesn't literally has variable names. Just references so dont care about the length and more about the sense of your variable names ;).

like image 72
Spitzbueb Avatar answered Feb 09 '23 22:02

Spitzbueb


Compiler works only with references, and all they have the same length, that is based on your device's architecture. Also you can imagine some table with all variable names and references on it. To save all that names is used some space, but this is even not funny joke because of text format is perfect for storing and that space is smaller then few kilobytes. And by default compiler leave that table with references and names. But in such case everybody can decompile your app and understand your code, because of variable's names have some meanings. If you want to make some hurdles you can set option to change all variable names to something like v1, v2, v3... etc.

like image 41
RevakoOA Avatar answered Feb 09 '23 22:02

RevakoOA