envoy icon indicating copy to clipboard operation
envoy copied to clipboard

mobile: Rewrite Java/JNI stream callbacks

Open fredyw opened this issue 9 months ago • 2 comments

This PR rewrites the Java/JNI implementation of the stream callbacks by removing a lot of indirection. This should reduce the number of translation layers, copies, as well as making the code easier to read and maintain. Prior to this PR, the filter and callback implementation was somewhat shared, but it makes the code confusing to read because there's some logic that's only relevant for the filters and vice versa. With the new implementation, the stream callback implementation is separate from the filter implementation, but some common helpers have been written so that the code can still be shared between the stream callback and filter implementations. In the next PR, I will update the filter implementation, so that we can finally get rid of the C wrapper types.

This PR also introduces the use of caching for jclass as per this recommendation: https://developer.android.com/training/articles/perf-jni#jclass,-jmethodid,-and-jfieldid

In the next PR, I will update the JNI code to cache all the jclass, jmethodID, and jFieldID.

Risk Level: medium Testing: unit & integration tests Docs Changes: n/a Release Notes: n/a Platform Specific Features: mobile

fredyw avatar May 17 '24 20:05 fredyw

As a reminder, PRs marked as draft will not be automatically assigned reviewers, or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

:cat:

Caused by: https://github.com/envoyproxy/envoy/pull/34234 was opened by fredyw.

see: more, trace.

/retest

fredyw avatar May 23 '24 23:05 fredyw

/retest

fredyw avatar May 24 '24 05:05 fredyw

/assign @abeyad

fredyw avatar May 24 '24 05:05 fredyw

/retest

fredyw avatar May 24 '24 16:05 fredyw

/retest

fredyw avatar May 24 '24 16:05 fredyw