JAX Finance Blog

Using Java Reflection to Debug Performance Issues

4 Jan 2018

Java reflection allows us to peek inside objects that we don't know, find their classes and then call methods and set fields. Great, but how can we use this practically in the "real world"?

In this talk, Dr. Heinz Kabuz shows how to find performance bottlenecks in Java using a profiler, as well as how to check if the profiler has found the mother lode by looking at the objects with reflection. In the first example provided, an open source tool that exhibited CPU bound performance issues is profiled. A typical bad coding paradigm is discovered, and Java reflection is used to test whether this bottleneck could be eliminated with a better hashing mechanism.
The second example provides an insight at the new Java 8 hash function inside HashMap. Debuggers hide the gory details of a HashMap from prying eyes, so reflection is used to output the contents of the array of buckets. This shows essential data about the effects of the new hash function. Java 8 HashMaps can perform 3x slower than previous versions! Using reflection, one can show why that is.
This talk is mostly live coding, with a few slides explaining how to find performance bottlenecks quickly.

JAX Finance 2016: Using Java Reflection to Debug Performance Issues from JAX TV on Vimeo.

BEHIND THE TRACKS

CONTINUOUS DELIVERY & AUTOMATION
Automate delivery and boost productivity
CORE JAVA & PROGRAMMINGv
The joy of being a software engineer
AGILE & COMPANY CULTURE
The process of becoming fully agile
SOFTWARE ARCHITECTURE
the dos and don’ts
BLOCKCHAIN TECHNOLOGY & SOLUTIONS
Get started with the tech and build apps on the Ethereum blockchain.
FINTECH & INNOVATION
Insight into the FinTech movement
HIGH PERFORMANCE & LOW LATENCY
Squeeze the best performance from your system
Agile & Company Culture

Agile & Company Culture

FinTech & Innovation

FinTech & Innovation

Continuous Delivery & DevOps

Continuous Delivery & DevOps

Software Architecture

Software Architecture

Core Java & Programming

Core Java & Programming

High Performance & Low Latency

High Performance & Low Latency

Blockchain Technology & Solutions

Blockchain Technology & Solutions