-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Describe the bug
When attempting to parse a simple JSON response using this library, I encountered performance issues. The library's parsing speed was slower compared to the native JSON.parse() method. Additionally, it caused the main thread to block indefinitely until the parsing process was completed. This experience was observed while running the code in a React Native Android application.
To Reproduce
Just create a new RN project and try to run the below code under a useEffect
export async function parseJSON() {
try {
for (let i = 0; i < 100; i++) {
const response = await fetch(
`https://microsoftedge.github.io/Demos/json-dummy-data/5MB.json`,
);
console.log('Got data');
const data = await response.text();
const parsedData = await parseAsync(data);
console.log('Parsed data');
}
} catch (e) {}
}
Expected behavior
The UI shouldn't be blocked until the parsing completed and it should be same speed as the JSON.parse() (Or atleast nearest)
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
"js-coroutines": "^2.4.36",
"react-native": "0.74.2",
Smartphone (please complete the following information):
- Device: Any Android phone (I have tested only on Android so far. Not sure about iOS)
Additional context
Add any other context about the problem here.