r/JavaProgramming • • Mar 10 '26

Don't guess, measure.

4 Upvotes

​I built a project to truly understand what happens inside the JVM when pushed to the limit.

The goal wasn't just "working code," but a deep understanding of memory utilization, CPU cycles, and runtime behavior.

​The task: Scanning a log file of one million lines and counting errors per hour.

​The process was divided into 4 versions, starting from the most naive implementation to optimization at the Bytecode and Assembly levels.

At each stage, I identified a specific bottleneck and improved it for the next version.

​The tools I used:

​JMH: For accurate micro-benchmarking while neutralizing Warmup biases.

​JITWatch: For analyzing C2 Compiler decisions and examining the final Assembly.

​The results:

​I started with a standard implementation running at 872ms with a significant load on the GC, and ended with an optimal implementation running at 78ms with 0 allocations. (On a limited hardware environment, which emphasizes the execution efficiency).

​To keep the code readable and focused on single-core performance, I chose to work with only one thread. The difference in performance stems solely from improving code efficiency and adapting it to the JVM architecture.

​You are welcome to view the process, the measurement documentation, and the source code on GitHub:

https://github.com/Yosefnago/java-deep-dive

​#Java #JVM #PerformanceTuning #BackendDevelopment #SoftwareEngineering #CleanCode #JIT #LowLatency #SoftwareArchitecture #DeepDive #CodingLife #JavaDeveloper #TechWriting


r/JavaProgramming • • Mar 09 '26

Learning java with the Telusko Channel: From Basics to Microservices

30 Upvotes

Firstly I learned java on brocode ,felt like learning in school.This is 2nd time I ma learning java .I’m currently working through the beginner course on the Telusko channel to build a solid foundation in Java. So far, I’ve completed about 75% of the playlist, and it's been a great learning experience. I'm planning to move on to Java Spring and microservices next, is this good .Like I don't wanted learning again And I also started making notes,I wanted to learn the backend.


r/JavaProgramming • • Mar 09 '26

Should I buy fasal memon Udemy course

2 Upvotes

I Currently learning Core java from Telusko,Going for back-end to microservices,It has yt channel video,yt video is good or should I buy the course,if any one has bought please give me some suggestions


r/JavaProgramming • • Mar 09 '26

JAVA course

4 Upvotes

I'm learning Java so I can do DSA in Java, but I'm not sure if I need to study on YouTube or take a course. Would it be better to watch Durga Sir's playlist or some other channel?


r/JavaProgramming • • Mar 09 '26

For anyone who wants free 250 credits on windsurf

Thumbnail
reddit.com
2 Upvotes

r/JavaProgramming • • Mar 08 '26

Spring AI

10 Upvotes

Does anyone know what it is?. I'm planning to learn it will it be useful for my career?


r/JavaProgramming • • Mar 08 '26

For JAVA group

5 Upvotes

Im a btech student learning java nd dsa .Is there any serious coding whatsapp group for practice? I want to connect with serious learners.


r/JavaProgramming • • Mar 08 '26

Don't guess, measure.

2 Upvotes

​I built a project to truly understand what happens inside the JVM when pushed to the limit.

The goal wasn't just "working code," but a deep understanding of memory utilization, CPU cycles, and runtime behavior.

​The task: Scanning a log file of one million lines and counting errors per hour.

​The process was divided into 4 versions, starting from the most naive implementation to optimization at the Bytecode and Assembly levels.

At each stage, I identified a specific bottleneck and improved it for the next version.

​The tools I used:

​JMH: For accurate micro-benchmarking while neutralizing Warmup biases.

​JITWatch: For analyzing C2 Compiler decisions and examining the final Assembly.

​The results:

​I started with a standard implementation running at 872ms with a significant load on the GC, and ended with an optimal implementation running at 78ms with 0 allocations. (On a limited hardware environment, which emphasizes the execution efficiency).

​To keep the code readable and focused on single-core performance, I chose to work with only one thread. The difference in performance stems solely from improving code efficiency and adapting it to the JVM architecture.

​You are welcome to view the process, the measurement documentation, and the source code on GitHub:

https://github.com/Yosefnago/java-deep-dive

​#Java #JVM #PerformanceTuning #BackendDevelopment #SoftwareEngineering #CleanCode #JIT #LowLatency #SoftwareArchitecture #DeepDive #CodingLife #JavaDeveloper #TechWriting


r/JavaProgramming • • Mar 08 '26

Core JAVA notes

12 Upvotes

If anyone has it, please share it.


r/JavaProgramming • • Mar 08 '26

Build Email Address Parser (RFC 5322) with Parser Combinator, Not Regex.

Thumbnail reddit.com
1 Upvotes

r/JavaProgramming • • Mar 08 '26

uh so i made YouTube for J2ME dumbphones

Thumbnail reddit.com
1 Upvotes

r/JavaProgramming • • Mar 08 '26

I found Leetcode for System Design and its Awesome

Thumbnail
javarevisited.blogspot.com
6 Upvotes

r/JavaProgramming • • Mar 07 '26

From Transactions to Queries: Breaking Down SAGA and CQRS

Thumbnail
javarevisited.substack.com
2 Upvotes

r/JavaProgramming • • Mar 05 '26

AxiomIDE

Thumbnail reddit.com
1 Upvotes

r/JavaProgramming • • Mar 05 '26

I built an event-driven payment API with Spring Boot, RabbitMQ and PostgreSQL

19 Upvotes

Hi everyone!

I built a backend project to practice event-driven architecture using Java and Spring Boot.

The application simulates a payment system where order creation publishes an event that is processed asynchronously through RabbitMQ.

Tech stack:

- Java 21

- Spring Boot

- PostgreSQL

- RabbitMQ

- Docker

- Swagger

- Maven

Features:

- Create orders

- Update order status

- Event publishing with RabbitMQ

- Asynchronous consumer

- Global exception handling

- REST API documentation with Swagger

Repository:

https://github.com/marconi-prog/fintech-payment-api

Feedback is very welcome!


r/JavaProgramming • • Mar 05 '26

PSA: If you use pac4j for JWT authentication, you need to patch immediately, CVSS 10.0 auth bypass

4 Upvotes

Heads up for anyone running pac4j-jwt in production.

CVE-2026-29000 dropped yesterday. CVSS 10.0. The issue is in JwtAuthenticator, if your app accepts encrypted JWTs (JWE), an attacker who has your RSA public key (which is... public) can craft a JWE-wrapped PlainJWT with arbitrary claims. Arbitrary subject, arbitrary roles. They bypass signature verification entirely and can impersonate any user, including admins.

Affected versions:

•⁠ ⁠ppac4j-jwt< 4.5.9

•⁠ ⁠pac4j-jwt < 5.7.9

•⁠ ⁠pac4j-jwt < 6.3.3

Advisory from pac4j: https://www.pac4j.org/blog/security-advisory-pac4j-jwt-jwtauthenticator.html

Technical writeup: https://www.codeant.ai/security-research/pac4j-jwt-authentication-bypass-public-key


r/JavaProgramming • • Mar 05 '26

Building immutable objects in Java is not trivial.

Post image
0 Upvotes

In clean architectures, maintaining immutability is key to avoiding unexpected side effects and facilitating testing. The Builder pattern helps encapsulate complex object creation without sacrificing clarity or flexibility.

Key points:

⚙️ Builder decouples object construction from its final representation.

🧱 Ensures immutability by creating objects with all their properties defined at the end.

🔧 Facilitates extensibility without modifying existing code, aligned with the open/closed principle.

🚀 Improves maintainability and readability in domain layers where objects are at the core of the logic.


r/JavaProgramming • • Mar 03 '26

Optimizing Recommendation Systems with JDK’s Vector API

Thumbnail netflixtechblog.com
3 Upvotes

r/JavaProgramming • • Mar 03 '26

Hello.

6 Upvotes

Hello everyone, I'm new to scheduling Java and I really need tips that helped you at the beginning of your learning, can you help me?


r/JavaProgramming • • Mar 02 '26

Help with extracting and comparing dates in Java for LLM

6 Upvotes

Hi everyone, i need some help. I have a large text that contains dates, and i need to extract them so i can compare them using an LLM to check if they are identical or not.

There are two types of dates in my text:

1- Literal dates: “In the year two thousand and twenty-two, on the twelfth day of the month of September”

2- Numeric dates: “12 September 2022”

I tried to extract and analyze them using only the LLM, but for some reason, even when the two dates are not the same, it sometimes returns that they are.

Now, I want to try extracting the dates in Java, saving them into two variables, and then passing them to the LLM. I think regex could work, but I’m not sure if that’s the best approach.

Has anyone done something similar or can suggest the best way to handle this?


r/JavaProgramming • • Mar 01 '26

Building a New Spring Data Module

Thumbnail
reddit.com
1 Upvotes

r/JavaProgramming • • Feb 28 '26

Spring Boot + MongoDB Saving Data to test Database Instead of Configured DB

11 Upvotes

Hello everyone,

Recently I started working with Spring Boot and MongoDB. I configured the application.properties file properly for MongoDB, but I’m facing an issue.

After creating REST APIs and inserting data, the data is getting persisted in the default test database instead of my configured database.

I have tried multiple fixes, but the issue is still not resolved.

</> application.properties
spring.application.name=TestMongoDB
server.port=8081
spring.data.mongodb.uri=mongodb://localhost:27017/db_mongo