<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/java-profiling-hazelcast-performance-tuning-of-hazelcast-sql-engine-rky1312xy" -->

---
title: [Java][Profiling][Hazelcast] Performance tuning of...
description: A detailed engineering account of tuning Hazelcast's SQL engine to match the performance of its older Predicate API ahead of deprecating the latter. Using...
canonical: https://daily.dev/posts/java-profiling-hazelcast-performance-tuning-of-hazelcast-sql-engine-rky1312xy
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: [Java][Profiling][Hazelcast] Performance tuning of Hazelcast SQL engine | daily.dev
og:description: A detailed engineering account of tuning Hazelcast's SQL engine to match the performance of its older Predicate API ahead of deprecating the latter. Using...
og:url: https://daily.dev/posts/java-profiling-hazelcast-performance-tuning-of-hazelcast-sql-engine-rky1312xy
og:image: https://api.daily.dev/og/posts/rky1312xY.png
og:image:alt: [Java][Profiling][Hazelcast] Performance tuning of Hazelcast SQL engine
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# [Java][Profiling][Hazelcast] Performance tuning of Hazelcast SQL engine

**[Krzysztof Ślusarski](https://daily.dev/sources/krzysztofslusarski)** · 13 min read · 0 upvotes · 0 comments

## Summary

A detailed engineering account of tuning Hazelcast's SQL engine to match the performance of its older Predicate API ahead of deprecating the latter. Using Async-profiler in wall-clock mode and flame graphs, the team found and fixed four distinct bottlenecks: a LinkedList used with O(size) get() calls on the client side, missing class-definition caching causing repeated Class.forName() calls, a Guava ReentrantLock-based cache causing contention during JSON path evaluation, and oversized buffer allocation in SenderTasklet during query deployment. Fixes reduced allocation rate from 3.8GB/s to 1.5GB/s and mean latency from 4.5ms to 1.8ms on a stressed cluster for a single-row indexed query. The piece closes with reusable lessons: performance work is never finished, unconventional debugging techniques are valid if they work, third-party libraries can hide bottlenecks, and avoiding allocation beats optimizing it.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://krzysztofslusarski.github.io/2022/08/25/hz-sql.html>

## Questions this post answers

### Why was Hazelcast's SQL engine slower than the Predicate API for simple queries?

Several distinct bottlenecks caused this: client-side code used a LinkedList.get() call with O(size) complexity to fetch column values, the SQL path lacked a class-definition cache that the Predicate API already had (costing about 25% of deserialization time on Class.forName calls), a Guava ReentrantLock-based cache created contention during JSON path evaluation (about 70% of evaluation time), and SenderTasklet allocated an oversized 32k buffer even for single-row queries.

_Developers debugging distributed query engine latency can find similar profiling breakdowns on daily.dev._

### How did switching a Guava cache to ConcurrentHashMap improve JSON value evaluation performance in Hazelcast SQL?

Replacing a Guava cache (which used ReentrantLock internally) with ConcurrentHashMap significantly reduced lock contention because the cache usage pattern was single insert with multiple reads, a pattern where ReentrantLock underperforms compared to CHM. This lock acquisition had consumed about 70% of the time spent evaluating a JSON path value in SQL queries against JSON-serialized data.

_Anyone choosing between caching strategies under high read concurrency can compare real trade-offs like this on daily.dev._

### How much did reducing buffer allocation size improve Hazelcast SQL query deployment latency?

Using a smaller initial buffer size (1k, expanding to 32k only when needed) in SenderTasklet, plus skipping creation of SenderTasklet instances that never send network data, dropped allocation rate from 3.8GB/s to 1.5GB/s and reduced mean query latency from 4.5ms to 1.8ms on a stressed four-node Hazelcast cluster running JDK17.

_Engineers chasing allocation-driven latency spikes can track profiling case studies like this on daily.dev._

## Similar posts on daily.dev

- [In Relation To](https://daily.dev/posts/in-relation-to-uccmjkghe) · Hibernate Blog · 4 upvotes · 0 comments
- [Why You Should Tune Code Before Your Garbage Collector](https://daily.dev/posts/why-you-should-tune-code-before-your-garbage-collector-7dmf5pz8z) · Hacker News · 1 upvotes · 0 comments
- [A Java Performance Quest: Taming Unsafe Code, Embracing Idiomatic Style & Debugging the Linux Kernel](https://daily.dev/posts/a-java-performance-quest-taming-unsafe-code-embracing-idiomatic-style-debugging-the-linux-kernel-f98cfswab) · InfoQ · 13 upvotes · 0 comments
- [What five P99 CONF talks reveal about database trade-offs](https://daily.dev/posts/what-five-p99-conf-talks-reveal-about-database-trade-offs-ugm1hn9ir) · The New Stack · 0 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#java](https://daily.dev/tags/java)

[View this post on daily.dev](https://daily.dev/posts/java-profiling-hazelcast-performance-tuning-of-hazelcast-sql-engine-rky1312xy)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"[Java][Profiling][Hazelcast] Performance tuning of Hazelcast SQL engine","url":"https://daily.dev/posts/java-profiling-hazelcast-performance-tuning-of-hazelcast-sql-engine-rky1312xy","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/java-profiling-hazelcast-performance-tuning-of-hazelcast-sql-engine-rky1312xy"},"datePublished":"2026-09-27T07:26:30.743Z","dateModified":"2026-09-27T07:57:41.656Z","description":"A detailed engineering account of tuning Hazelcast's SQL engine to match the performance of its older Predicate API ahead of deprecating the latter. Using...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ba401c218f42e5ea65cfbb4c48fc564d?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ba401c218f42e5ea65cfbb4c48fc564d?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Krzysztof Ślusarski","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Krzysztof Ślusarski","logo":"https://media.daily.dev/image/upload/logos/placeholder.jpg","url":"https://daily.dev/sources/krzysztofslusarski"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/java-profiling-hazelcast-performance-tuning-of-hazelcast-sql-engine-rky1312xy","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"performance,java","timeRequired":"PT13M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Krzysztof Ślusarski","item":"https://daily.dev/sources/krzysztofslusarski"},{"@type":"ListItem","position":3,"name":"[Java][Profiling][Hazelcast] Performance tuning of Hazelcast SQL engine"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/java-profiling-hazelcast-performance-tuning-of-hazelcast-sql-engine-rky1312xy#faq","mainEntity":[{"@type":"Question","name":"Why was Hazelcast's SQL engine slower than the Predicate API for simple queries?","acceptedAnswer":{"@type":"Answer","text":"Several distinct bottlenecks caused this: client-side code used a LinkedList.get() call with O(size) complexity to fetch column values, the SQL path lacked a class-definition cache that the Predicate API already had (costing about 25% of deserialization time on Class.forName calls), a Guava ReentrantLock-based cache created contention during JSON path evaluation (about 70% of evaluation time), and SenderTasklet allocated an oversized 32k buffer even for single-row queries. Developers debugging distributed query engine latency can find similar profiling breakdowns on daily.dev."}},{"@type":"Question","name":"How did switching a Guava cache to ConcurrentHashMap improve JSON value evaluation performance in Hazelcast SQL?","acceptedAnswer":{"@type":"Answer","text":"Replacing a Guava cache (which used ReentrantLock internally) with ConcurrentHashMap significantly reduced lock contention because the cache usage pattern was single insert with multiple reads, a pattern where ReentrantLock underperforms compared to CHM. This lock acquisition had consumed about 70% of the time spent evaluating a JSON path value in SQL queries against JSON-serialized data. Anyone choosing between caching strategies under high read concurrency can compare real trade-offs like this on daily.dev."}},{"@type":"Question","name":"How much did reducing buffer allocation size improve Hazelcast SQL query deployment latency?","acceptedAnswer":{"@type":"Answer","text":"Using a smaller initial buffer size (1k, expanding to 32k only when needed) in SenderTasklet, plus skipping creation of SenderTasklet instances that never send network data, dropped allocation rate from 3.8GB/s to 1.5GB/s and reduced mean query latency from 4.5ms to 1.8ms on a stressed four-node Hazelcast cluster running JDK17. Engineers chasing allocation-driven latency spikes can track profiling case studies like this on daily.dev."}}]}
```

