vivo Internet Technology
vivo Internet Technology
Aug 17, 2022 · Backend Development

Can JNI Supercharge Your Java Services? A Hands‑On Performance Journey

Facing heavy GC overhead and slow model inference in a Java compute service, the authors explore using Java Native Interface to offload file loading and regression calculations to C++, detailing environment setup, Maven integration, native method implementation, common pitfalls, performance testing with JMH, and achieving up to 80% latency reduction.

C++JNIJava
0 likes · 20 min read
Can JNI Supercharge Your Java Services? A Hands‑On Performance Journey
UCloud Tech
UCloud Tech
Mar 14, 2018 · Backend Development

How to Call C/C++ Libraries from Java Using JNA: A Practical Guide

This article explains how to access native C/C++ functions and complex structures from Java using JNI, JNA, and SWIG, compares their trade‑offs, provides type‑mapping tables, detailed code examples for struct definitions, passing, and callbacks, and offers practical tips for reliable cross‑language integration.

C++JNAJNI
0 likes · 9 min read
How to Call C/C++ Libraries from Java Using JNA: A Practical Guide