December 27, 2021, 9:13am
I have a long JSON string that I need to decode. The script timeouts when I try to use Roblox’s JSONDecode function from HTTPService.
The string is around 100 million characters.
Splitting the string wouldn’t work, to my knowledge, as the closing brackets of the table might not be included in each split, resulting in an error.
I’ve tried importing third-party JSON decoders and manually adding a wait, to prevent timeouts. However, this process takes forever to decode. Around 3 times longer than Roblox’s JSON Decoder.
Any suggestions or solutions or changes to my approach would be appreciated. Thank you!
Why do you have such a long JSON object? (I’m asking so I can establish any possible alternatives)
December 27, 2021, 9:17am
I’m planning to improve this project.
Roblox Video Player - #45 by JonYawns
Perhaps you can do something like:
local i = 1
local s, e = pcall(function()
i += 1
Then, return the frame via. the web server with the iteration provided in the URL query.
December 27, 2021, 9:38am
This could work, but I’m worried that I might go over Roblox’s 500 HTTP requests per minute. I am able to get the whole JSON data into a Roblox server without much trouble, so it’s most convenient if I solve this issue in Roblox itself, without external servers.
Try making it return say, 30 frames in one request then. I don’t think 60 will timeout either.
December 27, 2021, 9:45am
I’ll find a way to separate the frames then, thanks for the help!
December 27, 2021, 11:16am
This works! This can also solve my issue of having low fps and resolution.
Yay! Happy to solve your problem. Good luck with your project!