Refactor loadContexts and loadDebugImages to use JNI and FFI#3224
Conversation
…exts-load-debug-images
denrase
left a comment
There was a problem hiding this comment.
I suspect these speedups happen due to method channels being async and the event loop picking it up later vs FFI/JNI which runs sync
Does that mean we can't reliably say that this is faster, as the benchmark might be skewed through async/sync, with the latter blocking, while the former is doing other work? Any way to reliably benchmark this?
Might also be worth to benchmark the current encode/decode approach vs directly handing over data structures through FFI/JNI.
|
@denrase encoding decoding is 4x faster, I did some benchmarks on this Doing the conversion from NSDictionary was actually my first approach but noticed how slow it was (and complex) I'll do the benchmarks again regarding method channels (I'll start measuring inside the async body which should not include event loop time) |
|
@denrase changed up the benchmarks a bit and it's about ~2-3x faster than method channels (measured with average over 300 iterations) |
denrase
left a comment
There was a problem hiding this comment.
LGTM. Pls check why CI is failing and ignore if it's unrelated to this PR.
will update it |
📜 Description
Refactor
loadContextsandloadDebugImagesto use JNI and FFI for Android and iOS💡 Motivation and Context
Closes #3205
Local Benchmark Results
15 iterations of channel vs ffi/jni and calculating the avg while removing the first and last iteration to prevent extremes
💚 How did you test it?
Integration test, manual tests
📝 Checklist
sendDefaultPiiis enabled🔮 Next steps