Talk IndiaFOSS 2025

Cache Tactics: Optimizing Performance with Smart Eviction Strategies

Cache Tactics: Optimizing Performance with Smart Eviction Strategies

Session Description

Optimizing cache performance is a continuum and determining what stays in cache and what is evicted is a common dilemma. Given limited capacity of cache, data contend to stay in cache and programs strive to classify data that best suits cache ability. However, prediction of data longevity is complex and is a function of several external parameters. So, an efficient algorithm driving enterprise workloads works with realistic goal of obtaining near-optimal cache performance. We have been working with distributed cache over last 5 years and serving several customers with diverse workloads. Our role has gradually evolved into helping these workloads to fine-tune the distributed cache based specific data access patterns, thereby optimizing performance. Drawing from this experience, this session illustrates popular eviction algorithms and their tradeoffs, leveraging real-world examples to illustrate their impact. Attendees will learn cache optimization strategies that can significantly enhance their application performance.

Talk IndiaFOSS 2025

From JNI to the Future: The Evolution of Native Interoperability in Java

From JNI to the Future: The Evolution of Native Interoperability in Java

Session Description

As Java developers, we often need to interface with non-JVM libraries and services. Since its inception in Java 1.1, the Java Native Interface (JNI) has allowed Java code to call and interact with native applications and libraries, typically written in lower-level languages like C, which are closer to the hardware and operating system.
While JNI provides a bridge to native code, it comes with significant drawbacks in terms of performance, safety, and development complexity. Despite this, alternatives like Java Native Access (JNA), Java Abstract Foreign Function Layer (JNR-FFI), and JavaCPP offer more streamlined ways to access native code, though they still don’t fully match the ease of native interoperability found in languages like Python, which provide simpler, first-class integration without the need for extensive glue code.
Fortunately, the Foreign Function & Memory API from project Panama is set to change the game for Java developers. This new API is designed to offer a safer, more efficient approach to accessing native memory, while also making it easier to invoke native code.
Let's dive into the core features of the Foreign Function & Memory API and explore how it provides a safer, more supported alternative to JNI for native code interaction. Through concrete code examples, we’ll demonstrate how this new API works in practice. We'll also benchmark JNI vs. the Foreign Function & Memory API to highlight the performance improvements.