Browsed by
Year: 2020

Benchmark : conversion from long to byte[]

Benchmark : conversion from long to byte[]

I’ve been using Kafka a lot lately, and in Kafka a lot of things are byte arrays, even headers! As I have many components that exchange messages, I added headers to help with message tracking, including a timestamp header which has the value System.currentTimeMillis(). So I had to transform a long into a byte array; in a very naive way, I coded this: String.valueOf(System.currentTimeMillis()).getBytes(). But instantiating a String each time a header is created does not seem very optimal to…

Read More Read More

Profiling a GraalVM native image with perf

Profiling a GraalVM native image with perf

The GraalVM native-image tool allows you to generate a native executable (or native image) from your Java application. This native executable will start very quickly and have a much smaller memory footprint than a traditional Java application; at the cost of reduced peak performance and a relatively high packaging build time. More information on native executables here. A native executable contains a minimalist JVM called SubstratVM, this one has some limitations: Partial support for reflection Partial support for dynamic proxy…

Read More Read More

Java 15 : what’s new ?

Java 15 : what’s new ?

Now that Java 15 is features complete (Rampdown Phase One at the day of writing), it’s time to walk throught all it’s functionalities that brings to us, developers, this new version. This article is part of a series on what’s new on the last versions of Java, for those who wants to read the others, here are the links : Java 14, Java 13, Java 12, Java 11, Java 10, and Java 9. This new version brings lots of new JEPs, the main…

Read More Read More

Quarkus, jlink and Application Class Data Sharing (AppCDS)

Quarkus, jlink and Application Class Data Sharing (AppCDS)

Quarkus is optimized to start quickly and have a very small memory footprint. This is true when deploying in a standard JVM but even more so when deploying our application as a native executable via GraalVM. Quarkus greatly facilitates the creation of a native executable, thanks to this, a Quarkus application starts in a few tens of milliseconds and with a very small memory footprint: a few tens of MB of RSS (Resident Set Size – total memory usage of…

Read More Read More

Quarkus and Testcontainers

Quarkus and Testcontainers

If you did not know Quarkus, here is an introductory article: Zoom sur Quarkus (french). Quarkus offers Unit Test (TU) support with JUnit 5 via the @QuarkusTest annotation, documentation for Quarkus TU support can be found here. Here is an example of a TU from the Hibernate ORM Quickstart : Conventionally, you can run tests using an embedded database, Quarkus supports the H2 BDD for that. But if we want our tests to run in an environment as close as…

Read More Read More

Java 14 : what’s new ?

Java 14 : what’s new ?

Now that Java 14 is features complete (Rampdown Phase One at the day of writing), it’s time to walk throught all it’s functionalities that brings to us, developers, this new version. This article is part of a series on what’s new on the last versions of Java, for those who wants to read the others, here are the links : Java 13, Java 12, Java 11, Java 10, and Java 9. As opposite to the previous Java versions, the version 14…

Read More Read More