korlibs / korlibs/korlibs-ffi

Replace Proxy with MethodHandle

Open
#17 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

This week I fugured out that most of the time dynamic Proxies that perform castings and things like that that have a lot of overhead can be replaced with MethodHandles that are available since Java7. I believe Proxy is used at least in FFI/JNA/JVM code. Also the new API coming in JDK 22: https://openjdk.org/projects/jdk/22/ / https://openjdk.org/jeps/454 is based on MethodHandles. Also invokeExact is supported in Kotlin from several versions ago.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the Proxy usage in the FFI/JNA/JVM code and reading how its casting behavior is implemented. Compare those call paths with Java MethodHandles, including invokeExact support in Kotlin and the JDK 22 Foreign Function and Memory API references linked in the issue. Done means the relevant Proxy-based paths are replaced without changing their behavior, with performance and compatibility checked.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.