Statistics for the 1BRC Java Challenge
Minborg's Java Pot
by Per Minborg
3M ago
Introduction It is hard to avoid hearing about Gunnar Morling’s "One Billion Row Challenge" these days, where the objective is to parse and compute the min, average and max value for various weather stations using the Java language. The data to analyze is a semicolon-separated list of rows that looks like this: Hamburg;12.0 Bulawayo;8.9 Palembang;38.8 St. John's;15.2 Cracow;12.6 Bridgetown;26.9 Istanbul;6.2 Roseau;34.4 Conakry;31.2 Istanbul;23.0 As indicated by the name of the project, there are one billion such rows. I have struggled for several weeks not to enter t ..read more
Visit website
My Presentations at Devoxx BE 2023
Minborg's Java Pot
by Per Minborg
6M ago
Presentations at Devoxx BE October 2023 I did two presentations at Devoxx and also participated in the "Ask the Java Architects" presentation. Here are the videos of the presentations: Ask the Java Architects By Sharat Chander, Alan Bateman, Stuart Marks, Viktor Klang, Brian Goetz, and Per Minborg With Java 21, Your Code Runs Even Faster But How Is That Possible? By Per Minborg The Panama Dojo: Black Belt Programming with Java 21 and the FFM API by Per Minborg Here is the code I used in my presentations: Code: With Java 21, Your Code Runs Even Faster But How Is T ..read more
Visit website
Java Records are "Trusted" and Consequently Faster.
Minborg's Java Pot
by Per Minborg
7M ago
  Java Records are "Trusted" and Consequently Faster. Did you know Java records are trusted by the Hotspot VM in a special way? This makes their speed superior in some aspects compared to regular Java classes. In this short article, we will take a look at constant folding of instance fields and how this can bolster the performance of your Java application. Background Suppose we want to model an immutable point: public interface Point { int x(); int y(); } Before record classes were introduced in Java, data classes had to be "manually" coded using a regular Java ..read more
Visit website
Video: Project Panama and the Foreign Function and Memory API
Minborg's Java Pot
by Per Minborg
1y ago
The “Foreign Function and Memory API” (FFM), previewed in Java 20, allows Java programs to interoperate safely with code and data outside the Java runtime. In this fast-paced talk, we will explore what the FFM API has to offer and, via a hands-on live coding example, see how the promises of FFM can be realized in your code today. The live-code example involves integrating and using a native system call directly from Java. Here is a link to the 15-minute presentation. The presentation was made at jFocus 2023 in Stockholm ..read more
Visit website
JDK 21: Image Performance Improvements
Minborg's Java Pot
by Per Minborg
1y ago
Introduction In a previous article, I talked about how serialization and file I/O performance was improved in JDK 21 thanks to the use of VarHandleconstructs. The method employed there has now also been applied to Java’s image-handling library making it faster. Here is what happened: Background When packing/unpacking primitive values (such as int and long primitives) into/from a byte array, conversion was previously made using explicit bit shifting as shown in the ImageInputStreamImpl::readInt method below: public int readInt() throws IOExcepti ..read more
Visit website
Java 20: An Almost Infinite Memory Segment Allocator
Minborg's Java Pot
by Per Minborg
1y ago
Wouldn’t it be cool if you could allocate an infinite amount of memory? In a previous article, I elaborated a bit on how to create memory-mapped files which could be sparse. In this article, we will learn how this can be leveraged as an under-carriage for providing a memory-allocating arena that can return an almost infinite amount of native memory without ever throwing an OutOfMemoryError.  Arena An Arena controls the lifecycle of native memory segments, providing both flexible allocation and timely deallocation. There are two built-in Arena types in Java 20: A Confined Arena (avai ..read more
Visit website
Java 20: A Sneak Peek on the Panama FFM API (Second Preview)
Minborg's Java Pot
by Per Minborg
1y ago
The new JEP 434 has just seen daylight and describes the second preview of the ”Foreign Function & Memory API” (or FFM for short) which is going to be incorporated in the upcoming Java 20 release! In this article, we will take a closer look at some of the improvements made from the first preview that debuted in Java 19 via the older JEP 424. Getting familiar with the FFM This article assumes you are familiar with the FFM API. If not, you can get a good overview via the  new JEP Short Summary Here is a short summary of the FFM changes made in Java 20 compared to Java 19: The Memor ..read more
Visit website
Exhaustive JUnit5 Testing with Combinations, Permutations and Products
Minborg's Java Pot
by Per Minborg
2y ago
  Exhaustive JUnit5 Testing with Combinations, Permutations, and Products Unit testing constitutes an integral part of the process of providing high-quality software. But, how can one write tests covering all variants of several operations? Read this article and learn how to use JUnit5 in conjunction with combinations, permutations, and products. Test Support Libraries There are many libraries that make testing better in different aspects. Here are some of them: Agitar One Agitator automatically creates dynamic test cases, synthesizes sets of input data, and analyzes the results. http ..read more
Visit website
Which JVM Version is Fastest?
Minborg's Java Pot
by Per Minborg
2y ago
  Which JVM Version is Fastest? How is a high-performance, low-latency Java application affected by the JVM version used? Every nanosecond counts for trading and other applications where messages between two different threads are exchanged in about 500 ns! Read this article and find out which JDK variant comes out at the top! Benchmarks This article will use open-source Chronicle Queue to exchange 256-byte messages between two threads whereby all messages are also reliably persisted to disk.  Chronicle Queue is a persisted low-latency Java messaging framework for high-performance an ..read more
Visit website
How to Reduce Cloud Cost by 99% for EDA Kafka Applications
Minborg's Java Pot
by Per Minborg
2y ago
  How to Reduce Cloud Cost by 99% for EDA Kafka Applications While the cloud offers great convenience and flexibility, the operational cost for applications deployed in the cloud can sometimes be significant. This article shows a way to substantially reduce operating costs in latency-sensitive Event-Driven Architecture (EDA) Java applications by migrating from Kafka to Chronicle Queue open-source, a more resource-efficient and lower-latency queue implementation. What is EDA? An EDA application is a distributed application where events (in the form of messages or DTOs) are produced, detect ..read more
Visit website

Follow Minborg's Java Pot on FeedSpot

Continue with Google
Continue with Apple
OR