File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Performance and the fly likes Program speed, and performance. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Program speed, and performance." Watch "Program speed, and performance." New topic
Author

Program speed, and performance.

Preben
Greenhorn

Joined: May 17, 2000
Posts: 13
If I use very long variable identifiers. Will this in any
way "slow" down my programs?
I.E.:
String aVeryVeryVeryVeryLongIdentifier =new String("very long");
Has the access modifier any impact on my programs "speed" and
performance?
-Newbie Programmer
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
This is really a question more suited to the performance forum.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20498
    ∞

When the time comes to production, a lot of folks run their code through an obfuscator making this question moot.
I suppose it is possible that the name size can make a difference. But it would be up to the JVM that is running it.

permaculture Wood Burning Stoves 2.0 - 4-DVD set
Preben
Greenhorn

Joined: May 17, 2000
Posts: 13
Thanks!
I also think this is an excellent site!
Jack Shirazi
Author
Ranch Hand

Joined: Oct 26, 2000
Posts: 96
Longer class & method names should have only one performance impact, which is the size they have on the .class files. The JVM should not run any slower except for the minimal extra time it takes to load a large .class file (possibly including network downloads).
Variable names are different in that variable names are not retained directly in the bytecodes. Instead all variables are compiled to JVM addresses, and the length of the variable name makes no difference at all. However, the compiler is allowed to retain the variable names in the .class file in a separate variable name table, so that debuggers (and decompilers) can use the original names. By default most compilers do retain this table. Retaining the table has the same effect as noted for class/method names, i.e. a larger .class file. You can normally eliminate the variable name table using one of the compiler options, e.g. -O or -g:none (the option varies with the compiler), or you can use an optimizing recompiler that can strip out the variable name table after compilation (see the resources section at my site for a list of some tools that do this).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Program speed, and performance.
 
Similar Threads
Text in different colours
Java 1.3?
Measure Time
Is there any free libraries avaialble for file splitting usiong java??
Program speed, and performance.