mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.6k stars 1.1k forks source link

✨ Use Image HostObject for faster image capture #69

Open mrousavy opened 3 years ago

mrousavy commented 3 years ago

Currently image capture works like this:

-> means bridge call

With the upcoming React Native Re-Architecture this will change. Instead, I want to achieve the following:

=> means direct C++ function invocation, no bridge

This will provide huge performance improvements since 1. the entire async Bridge calls are gone, and 2. because the File IO is completely gone.

I'm estimating at least 200ms of faster capture. (measured File I/O quite a while ago)

To display my jsi::HostObject image, I either have to create a custom image component, or maybe React Native's Core Image component will support this out of the box.

We'll see.

MarcoScabbiolo commented 3 years ago

I think react-native's image should be responsible for supporting an in-memory image, or we would be duplicating a lot of code in many libraries. I can help contributing in the rn side if the HostObject is ready.

mrousavy commented 3 years ago

@MarcoScabbiolo I can create a jsi::HostObject image library, but I don't think RN Core is going to depend on a third party library. I think we have to maintain the Image UI component separately. That's not a big problem though, FastImage does this as well