Live Session on Performance Optimization Using 1BRC as a Case Study
We just concluded our first ever live session on performance engineering last Sunday. Many people expressed interest in it afterwards. Although, we did have a recording, I think the real value is in attending these things live and asking questions. I am going to do a repeat of this topic but with a different format
Topic and Format
During the previous session started by covering the background on x86 assembly and microarchitecture. While that background is great to have, it takes a lot of time to cover. This time I am going to spin it around and focus exclusively on 1BRC code and cover any required background as we go along making improvements in the code.
The goal of the session will be on learning to analyze and reason about the performance of the code. We will start with the naive version of a 1BRC implementation and iteratively optimize it one step at a time by analyzing the flamegraph.
It will mostly be live coding, with some detours along the way to understand any relevant concept that we might be using to optimize the performance. It will be more interactive and question driven than slide driven.
The goal is not to get to < 2 second runtime of our program in 2 hours, but to learn how to analyze and reason about the performance of the code and to see how it translates into changes in the code.
What Will We Learn?
During the course of the session we will touch upon and cover following topics and perhaps more:
Introduction to performance profiling with flamegraphs.
I/O strategies: unbuffered vs buffered I/O, memory-mapped I/O.
Understanding the cost of system calls and data copying.
Techniques for fast text parsing, including single-byte scanning and multi-byte SWAR techniques.
Instruction costs: weighing integer vs floating-point arithmetic.
Cache friendly and branch free coding techniques.
Leveraging SIMD instructions for computational optimization.
Prerequisites
You should have few years experience of writing code in a programming language like C, C++, Java, C#, Rust, Go etc.
All the code we will see will be in Java, but I will explain any Java specific details as we go along.
Date & Time
Date: 17th Feb, 2024
Time: 16:30 - 18:30 (We will have a strict cut off at 2 hr).
Logistics
For Existing Paid Subscribers
These sessions are free for the paid subscribers. So to attend it, you simply need to upgrade to a paid membership. I plan to offer such sessions every month going forward, so this will be money worth invested for you!
If You Purchased the Previous Session on this Topic
If you purchased the ticket for the previous version of this topic, then you don’t need to buy ticket for this version. I will email you the registration link separately soon (by tomorrow).
Buy Access to Just This Session
If you don’t wish to become a paid subscriber and just want to attend this session, you can do so by buying it directly using the following link.
Registration Link
I am keeping the event limited to 100 people at the moment, so if you are interested in attending it, you should RSVP as soon as possible. Even if you don’t attend, you will get access to the recording later if you RSVP.
You can RSVP at the following link: