netty / netty/netty

Turn hot/common JNI calls into Critical Native

Open
#12,895 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

important improvement
Dominant language
Java
Stars
35.1k
Forks
16.3k
Avg merge
1d 5h
Merged PRs (30d)
143

Description

JNI calls can be faster by respecting the JDK definition of Critica Native functions:
see https://github.com/franz1981/jdk11/blob/a060be188df894ed5c26fc12fc9e902f9af32bd3/src/hotspot/share/prims/nativeLookup.cpp#L277

and SO at https://stackoverflow.com/questions/36298111/is-it-possible-to-use-sun-misc-unsafe-to-call-c-functions-without-jni/36309652#36309652

Many of our epoll JNI methods (writev/recv/send) already use jlong vs buffer refs, meaning that they can be transformed in Critical Native functions, or at least explore if it's possible to do it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the JDK nativeLookup.cpp definition linked in the issue, then inspect Netty’s epoll JNI implementations for writev, recv, and send. Compare their jlong-based arguments with the Critical Native requirements and determine which calls qualify. Done means the eligible common calls are converted, or the investigation records why conversion is not possible.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, linux
Domain
networking, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.