logo rip
RIP Tutorial
  • Tags
  • Topics
  • Examples
  • eBooks
Download Java Language (PDF)

Java Language

  • Getting started with Java Language
  • Top 10 Java Errors with Solutions
  • Awesome Book
  • Awesome Community
  • Awesome Course
  • Awesome Tutorial
  • Awesome YouTube
  • 2D Graphics in Java
  • Alternative Collections
  • Annotations
  • Apache Commons Lang
  • AppDynamics and TIBCO BusinessWorks Instrumentation for Easy Integration
  • Applets
  • Arrays
  • Asserting
  • Atomic Types
  • Audio
  • Autoboxing
  • Basic Control Structures
  • Benchmarks
  • BigDecimal
  • BigInteger
  • Bit Manipulation
  • BufferedWriter
  • ByteBuffer
  • Bytecode Modification
  • C++ Comparison
  • Calendar and its Subclasses
  • Character encoding
  • Choosing Collections
  • Class - Java Reflection
  • Classes and Objects
  • Classloaders
  • Collection Factory Methods
  • Collections
  • Command line Argument Processing
  • Common Java Pitfalls
  • Comparable and Comparator
  • CompletableFuture
  • Concurrent Collections
  • Concurrent Programming (Threads)
  • Console I/O
  • Constructors
  • Converting to and from Strings
  • Creating Images Programmatically
  • Currency and Money
  • Date Class
  • Dates and Time (java.time.*)
  • Default Methods
  • Dequeue Interface
  • Disassembling and Decompiling
  • Documenting Java Code
  • Dynamic Method Dispatch
  • Encapsulation
  • Enum Map
  • Enum starting with number
  • Enums
  • EnumSet class
  • Exceptions and exception handling
  • Executor, ExecutorService and Thread pools
  • Expressions
  • File I/O
  • FileUpload to AWS
  • Fluent Interface
  • FTP (File Transfer Protocol)
  • Functional Interfaces
  • Generating Java Code
  • Generics
  • Getters and Setters
  • Hashtable
  • HttpURLConnection
  • Immutable Class
  • Immutable Objects
  • Inheritance
  • InputStreams and OutputStreams
  • Installing Java (Standard Edition)
  • Interfaces
  • Iterator and Iterable
  • Java Agents
  • Java Compiler - 'javac'
  • Java deployment
  • Java Editions, Versions, Releases and Distributions
  • Java Floating Point Operations
  • Java Memory Management
  • Java Memory Model
  • Java Native Access
  • Java Native Interface
  • Java Performance Tuning
  • Java Pitfalls - Exception usage
  • Java Pitfalls - Language syntax
  • Java Pitfalls - Nulls and NullPointerException
  • Java Pitfalls - Performance Issues
    • Pitfall - Calling 'new String(String)' is inefficient
    • Pitfall - Calling System.gc() is inefficient
    • Pitfall - Efficiency concerns with regular expressions
    • Pitfall - Interning strings so that you can use == is a bad idea
    • Pitfall - Iterating a Map's keys can be inefficient
    • Pitfall - Over-use of primitive wrapper types is inefficient
    • Pitfall - Small reads / writes on unbuffered streams are inefficient
    • Pitfall - String concatenation in a loop does not scale
    • Pitfall - The overheads of creating log messages
    • Pitfall - Using 'new' to create primitive wrapper instances is inefficient
    • Pitfall - Using size() to test if a collection is empty is inefficient.
  • Java Pitfalls - Threads and Concurrency
  • Java plugin system implementations
  • Java Print Service
  • Java SE 7 Features
  • Java SE 8 Features
  • Java Sockets
  • Java Virtual Machine (JVM)
  • JavaBean
  • JAXB
  • JAX-WS
  • JMX
  • JNDI
  • JShell
  • JSON in Java
  • Just in Time (JIT) compiler
  • JVM Flags
  • JVM Tool Interface
  • Lambda Expressions
  • LinkedHashMap
  • List vs SET
  • Lists
  • Literals
  • Local Inner Class
  • Localization and Internationalization
  • LocalTime
  • log4j / log4j2
  • Logging (java.util.logging)
  • Maps
  • Modules
  • Multi-Release JAR Files
  • Nashorn JavaScript engine
  • Nested and Inner Classes
  • Networking
  • New File I/O
  • NIO - Networking
  • Non-Access Modifiers
  • NumberFormat
  • Object Class Methods and Constructor
  • Object Cloning
  • Object References
  • Operators
  • Optional
  • Oracle Official Code Standard
  • Packages
  • Parallel programming with Fork/Join framework
  • Polymorphism
  • Preferences
  • Primitive Data Types
  • Process
  • Properties Class
  • Queues and Deques
  • Random Number Generation
  • Readers and Writers
  • Recursion
  • Reference Data Types
  • Reference Types
  • Reflection API
  • Regular Expressions
  • Remote Method Invocation (RMI)
  • Resources (on classpath)
  • RSA Encryption
  • Runtime Commands
  • Scanner
  • Secure objects
  • Security & Cryptography
  • Security & Cryptography
  • SecurityManager
  • Serialization
  • ServiceLoader
  • Sets
  • Singletons
  • Sockets
  • SortedMap
  • Splitting a string into fixed length parts
  • Stack-Walking API
  • Streams
  • String Tokenizer
  • StringBuffer
  • StringBuilder
  • Strings
  • sun.misc.Unsafe
  • super keyword
  • The Classpath
  • The Java Command - 'java' and 'javaw'
  • The java.util.Objects Class
  • ThreadLocal
  • TreeMap and TreeSet
  • Type Conversion
  • Unit Testing
  • Using Other Scripting Languages in Java
  • Using the static keyword
  • Using ThreadPoolExecutor in MultiThreaded applications.
  • Varargs (Variable Argument)
  • Visibility (controlling access to members of a class)
  • WeakHashMap
  • XJC
  • XML Parsing using the JAXP APIs
  • XML XPath Evaluation
  • XOM - XML Object Model


Java Language

  • Getting started with Java Language
  • Top 10 Java Errors with Solutions
  • Awesome Book
  • Awesome Community
  • Awesome Course
  • Awesome Tutorial
  • Awesome YouTube
  • 2D Graphics in Java
  • Alternative Collections
  • Annotations
  • Apache Commons Lang
  • AppDynamics and TIBCO BusinessWorks Instrumentation for Easy Integration
  • Applets
  • Arrays
  • Asserting
  • Atomic Types
  • Audio
  • Autoboxing
  • Basic Control Structures
  • Benchmarks
  • BigDecimal
  • BigInteger
  • Bit Manipulation
  • BufferedWriter
  • ByteBuffer
  • Bytecode Modification
  • C++ Comparison
  • Calendar and its Subclasses
  • Character encoding
  • Choosing Collections
  • Class - Java Reflection
  • Classes and Objects
  • Classloaders
  • Collection Factory Methods
  • Collections
  • Command line Argument Processing
  • Common Java Pitfalls
  • Comparable and Comparator
  • CompletableFuture
  • Concurrent Collections
  • Concurrent Programming (Threads)
  • Console I/O
  • Constructors
  • Converting to and from Strings
  • Creating Images Programmatically
  • Currency and Money
  • Date Class
  • Dates and Time (java.time.*)
  • Default Methods
  • Dequeue Interface
  • Disassembling and Decompiling
  • Documenting Java Code
  • Dynamic Method Dispatch
  • Encapsulation
  • Enum Map
  • Enum starting with number
  • Enums
  • EnumSet class
  • Exceptions and exception handling
  • Executor, ExecutorService and Thread pools
  • Expressions
  • File I/O
  • FileUpload to AWS
  • Fluent Interface
  • FTP (File Transfer Protocol)
  • Functional Interfaces
  • Generating Java Code
  • Generics
  • Getters and Setters
  • Hashtable
  • HttpURLConnection
  • Immutable Class
  • Immutable Objects
  • Inheritance
  • InputStreams and OutputStreams
  • Installing Java (Standard Edition)
  • Interfaces
  • Iterator and Iterable
  • Java Agents
  • Java Compiler - 'javac'
  • Java deployment
  • Java Editions, Versions, Releases and Distributions
  • Java Floating Point Operations
  • Java Memory Management
  • Java Memory Model
  • Java Native Access
  • Java Native Interface
  • Java Performance Tuning
  • Java Pitfalls - Exception usage
  • Java Pitfalls - Language syntax
  • Java Pitfalls - Nulls and NullPointerException
  • Java Pitfalls - Performance Issues
    • Pitfall - Calling 'new String(String)' is inefficient
    • Pitfall - Calling System.gc() is inefficient
    • Pitfall - Efficiency concerns with regular expressions
    • Pitfall - Interning strings so that you can use == is a bad idea
    • Pitfall - Iterating a Map's keys can be inefficient
    • Pitfall - Over-use of primitive wrapper types is inefficient
    • Pitfall - Small reads / writes on unbuffered streams are inefficient
    • Pitfall - String concatenation in a loop does not scale
    • Pitfall - The overheads of creating log messages
    • Pitfall - Using 'new' to create primitive wrapper instances is inefficient
    • Pitfall - Using size() to test if a collection is empty is inefficient.
  • Java Pitfalls - Threads and Concurrency
  • Java plugin system implementations
  • Java Print Service
  • Java SE 7 Features
  • Java SE 8 Features
  • Java Sockets
  • Java Virtual Machine (JVM)
  • JavaBean
  • JAXB
  • JAX-WS
  • JMX
  • JNDI
  • JShell
  • JSON in Java
  • Just in Time (JIT) compiler
  • JVM Flags
  • JVM Tool Interface
  • Lambda Expressions
  • LinkedHashMap
  • List vs SET
  • Lists
  • Literals
  • Local Inner Class
  • Localization and Internationalization
  • LocalTime
  • log4j / log4j2
  • Logging (java.util.logging)
  • Maps
  • Modules
  • Multi-Release JAR Files
  • Nashorn JavaScript engine
  • Nested and Inner Classes
  • Networking
  • New File I/O
  • NIO - Networking
  • Non-Access Modifiers
  • NumberFormat
  • Object Class Methods and Constructor
  • Object Cloning
  • Object References
  • Operators
  • Optional
  • Oracle Official Code Standard
  • Packages
  • Parallel programming with Fork/Join framework
  • Polymorphism
  • Preferences
  • Primitive Data Types
  • Process
  • Properties Class
  • Queues and Deques
  • Random Number Generation
  • Readers and Writers
  • Recursion
  • Reference Data Types
  • Reference Types
  • Reflection API
  • Regular Expressions
  • Remote Method Invocation (RMI)
  • Resources (on classpath)
  • RSA Encryption
  • Runtime Commands
  • Scanner
  • Secure objects
  • Security & Cryptography
  • Security & Cryptography
  • SecurityManager
  • Serialization
  • ServiceLoader
  • Sets
  • Singletons
  • Sockets
  • SortedMap
  • Splitting a string into fixed length parts
  • Stack-Walking API
  • Streams
  • String Tokenizer
  • StringBuffer
  • StringBuilder
  • Strings
  • sun.misc.Unsafe
  • super keyword
  • The Classpath
  • The Java Command - 'java' and 'javaw'
  • The java.util.Objects Class
  • ThreadLocal
  • TreeMap and TreeSet
  • Type Conversion
  • Unit Testing
  • Using Other Scripting Languages in Java
  • Using the static keyword
  • Using ThreadPoolExecutor in MultiThreaded applications.
  • Varargs (Variable Argument)
  • Visibility (controlling access to members of a class)
  • WeakHashMap
  • XJC
  • XML Parsing using the JAXP APIs
  • XML XPath Evaluation
  • XOM - XML Object Model

Java Language Java Pitfalls - Performance Issues


Introduction

This topic describes a number of "pitfalls" (i.e. mistakes that novice java programmers make) that relate to Java application performance.

Remarks

This topic describes some "micro" Java coding practices that are inefficient. In most cases, the inefficiencies are relatively small, but it is still worth avoiding them is possible.

Java Pitfalls - Performance Issues Related Examples

  • Pitfall - Calling 'new String(String)' is inefficient
  • Pitfall - Calling System.gc() is inefficient
  • Pitfall - Efficiency concerns with regular expressions
  • Pitfall - Interning strings so that you can use == is a bad idea
  • Pitfall - Iterating a Map's keys can be inefficient
  • Pitfall - Over-use of primitive wrapper types is inefficient
  • Pitfall - Small reads / writes on unbuffered streams are inefficient
  • Pitfall - String concatenation in a loop does not scale
  • Pitfall - The overheads of creating log messages
  • Pitfall - Using 'new' to create primitive wrapper instances is inefficient
  • Pitfall - Using size() to test if a collection is empty is inefficient.



pdf PDF - Download Java Language for free


Previous Next






This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0
This website is not affiliated with Stack Overflow

logo rip
SUPPORT & PARTNERS
  • Advertise with us
  • Contact us
  • Privacy Policy
STAY CONNECTED

Get monthly updates about new articles, cheatsheets, and tricks.