HomePhabricator
Diffusion Comm 0cbe6716f620

[native] Use BlobUtils for media encryption/decryption

Description

[native] Use BlobUtils for media encryption/decryption

Summary:
This diff increases the performance of media encryption/decryption by using newly introduced methods instead
of basing on response.arrayBuffer() which uses slow base64 under the hood. Details are described in parent diffs and
in the task issue.

Depends on D7974

Test Plan:
Ensured that media encryption/decryption still works as expected.
For these more curious, you can check performance using the following:

const startTime = Date.now();
// code from this diff here
console.log('Time:', Date.now() - startTime);

In my case, the time went down from hundreds of milliseconds to 1-2ms.

Reviewers: atul, marcin

Reviewed By: atul, marcin

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D7976

Details

Provenance
bartekAuthored on May 25 2023, 7:20 AM
Reviewer
atul
Differential Revision
D7976: [native] Use BlobUtils for media encryption/decryption
Parents
rCOMMca7dc26f16b4: [native] Implement BlobUtils expo-module on Android
Branches
Unknown
Tags
Unknown