Skip to content

Reading files from bundle assets is extremely slow #102

Open
@devxpy

Description

@devxpy

react-native-fetch-blob@0.10.8

test code:

import RNFetchBlob from "react-native-fetch-blob";
const { fs } = RNFetchBlob;

const t1 = performance.now();
fs.readFile(
    fs.asset("bundle-assets://" + filename),
    "ascii"
).then(data => {
    console.log(performance.now() - t1);
});

results from a Nexus 5 running a development build of the app:

All tests were run whilst a <ActivityIndicator /> was running in the foreground..

Results are in millisecond, as returned by performance.now()

size time (ms)
9.7 MB crash and burn
4 MB 144132.19999999274
3.2 MB 115553.40000000433
1.6 MB 59854.999999995925
781 KB 28170.59999999765
78 KB 3373.600000006263

If anyone wants the files, i am happy to provide. (some xor encrypted pdf files)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions