|
|
|
|
|
|
|
|
|
Efficient Java |
Duration: 2 days |
|
|
- Application and Enterprise developers
- System designers
- Consultants
|
|
Java development experience, or previous courseware similar to Basic Java. |
|
|
Description |
This course significantly enhances the skills of the Java developer. Students are immersed in efficiency issues and tradeoffs that are unique to the Java programming environment, through lectures and hands-on lab exercises. Optimizations include everything from simple refresher concepts, code sequences, and statement tradeoffs to implementing efficient synchronization, object pooling, caching, and optimized searches. |
|
Objectives |
Efficient Java has been carefully planned to help students create faster, smaller, and more efficient
Java applications. Student ease into the new concepts with the use
of numerous exercises, labs, and sample code. At the end of this course,
students should be able to:
- Use the Java profiler
and disassembler
- Identify efficiency
tradeoffs between basic language constructs
- Use assertions to support
Design by Contract
- Implement Object methods
correctly
- Understand object pooling
and caching
- Programatically interact
with the JVM environment
- Use the String class
optimally
- Understand tradeoffs
in the collection classes
- Implement exceptions
efficiently
- Optimize the use of
I/O and serialization
- Identify the tradeoffs
between synchronization primitives
|
|
Course Outline |
Measuring Efficiency
- Judicious Optimization
- Data Structures and Algorithms
- Java ByteCode (javap)
- Java Profiler (hprof)
- Just-In-Time, HotSpot
Efficienct Primitives
- Switch vs. If
- Inlining: Static, Private, Final
- Null vs length()==0
- Minimal scope
- Numeric Primitives/References
- Reflection: Use and Cost
- Assertions and Contracts
Object Construction
- Initialization
- Overriding Object’s Methods
- Object Pooling
- Class Loading
System Control
- Memory Management
- Garbage Collection
- System/Environment Properties
- Impact of the Security Manager
|
|
Strings
- Immutable Class Efficiency
- Converting to/from String
- Optimizing Searches
Data Structures & Sorting
- Array, Vector, ArrayList
- Resizing an Array
- Collections and Iterators
- Sets, Maps, and Sorting
- Properties and Resource Bundles
- Caching
Exceptions
- Exceptional Conditions Only
- The Cost to Throw
- Checked vs. Unchecked
- Ignoring and Hiding Exceptions
Input/Output
- Compression
- Serialization
Threading
- Background Processing
- Atomicity
- Alternatives for Shared Access
- Synchronization Byte Code
|
|
|
|