Carousel Studio

Repurpose X Threads into LinkedIn & Instagram Carousels

Canvas & Ratio

Choose your destination platform format


Layout Template

Choose a content structure for your slides


Preset Themes


Typography & Sizing

Title Font Size36px
Body Font Size18px
Header & Footer Size12px

Brand Kit Customization

AGENCY

Configure brand assets for headers & footers

MULTI-PROFILES (AGENCY)
AGENCY
SAVE PRESETS (AGENCY)

Outro Slide CTA

Customize your closing call-to-action slide

#1
#2
#3

Background Pattern

Source Content

Build Your Carousel

Drag and drop any post card below onto a slide, or use the quick buttons to insert content/images instantly!

Drag Post #1
Geoffrey De Smet
@GeoffreyDeSmet

You can probably optimize your @Java programs to run 2-10x faster, by focusing on the bottlenecks. Those bottlenecks are not where you think they are. Use free tools such as async-profiler, VisualVM, JFR and vmstat to find them. Let me show you how. ๐Ÿงต

Drag Post #2
Geoffrey De Smet
@GeoffreyDeSmet

Create a main() Java application that runs the bulk of your code on a seriously sized dataset for at least a minute. Run async-profiler and Java Flight Recorder (JFR) on that, either from the command line (free) or through @intellijidea Ultimate (paid) as shown below.

Apply Image
Drag Post #3
Geoffrey De Smet
@GeoffreyDeSmet

1) Async-profiler outputs a flamegraph to show the relative CPU time taken by each method (including methods it calls). Slow methods stick out like a soar thumb, even if they loop (unlike in other visualizations). This graph made one of our use cases 10x faster.

Apply Image
Drag Post #4
Geoffrey De Smet
@GeoffreyDeSmet

Async-profiler doesn't suffer from Safepoint Bias. This means it's more honest than: - VisualVM's sampler which rounds measurements to the nearest safepoint - VisualVM instrumentation profiler which inflates short methods that are called a lot with instrumentation overhead

Drag Post #5
Geoffrey De Smet
@GeoffreyDeSmet

2) VisualVM is useful too, to quickly monitor GC activity, detect potential memory leaks etc. Download and run it, then start your main(), double click on your process in the VisualVM list and switch to the monitor tab:

Apply Image
Drag Post #6
Geoffrey De Smet
@GeoffreyDeSmet

3) Java Flight Recorder (JFR) shows memory allocations and lock congestion. To get memory allocations data in @intellijidea you need to explicitly change its settings, for a performance overhead. (Thanks to Jeremy Whiting for teaching me at @DevoxxUK)

Apply Image
Drag Post #7
Geoffrey De Smet
@GeoffreyDeSmet

The JFR data is stored in your home folder by default. Download and run Java Mission Control (JMC) to open these files and visualize the data recorded by Java Flight Recorder. Then switch to the TLAB Allocations screen.

Apply Image
Drag Post #8
Geoffrey De Smet
@GeoffreyDeSmet

JFR records all memory allocations. Every memory allocation costs CPU time for creation and CPU time for Garbage Collection. This method allocated 7GB per minute in some configurations. Now, it does the same functionality with a fraction of that, significantly faster.

Apply Image
Drag Post #9
Geoffrey De Smet
@GeoffreyDeSmet

4) vmstat The tools in above work on the JVM level. The real truth is at the OS level, as explained by Kirk Pepperdine (@kcpeppe) at @Jfokus. Especially to detect Noisy Neighbors (other containers/VM with which you share a bare metal machine). Call vmstat on the linux cmd line:

Apply Image
Drag Post #10
Geoffrey De Smet
@GeoffreyDeSmet

I hope you found this thread useful. Anything important that I missed?

Drag Post #11
Geoffrey De Smet
@GeoffreyDeSmet

Coincidentally, the mailman just now delivered the "Optimizing Java" book by Ben Evans (@kittylyst), so I'll probably learn a bunch more about performance tuning over the next few weeks.

Apply Image