Large JSON Timeout

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!

2 Likes

Why do you have such a long JSON object? (I’m asking so I can establish any possible alternatives)

1 Like

I’m planning to improve this project.Video Player Using Frames - #45 by JonYawns

Perhaps you can do something like:

local i = 1
repeat
local s, e = pcall(function()
request(url..'/'..tostring(i))
i += 1
end)
until e

Then, return the frame via. the web server with the iteration provided in the URL query.

1 Like

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.

1 Like

Try making it return say, 30 frames in one request then. I don’t think 60 will timeout either.

2 Likes

I’ll find a way to separate the frames then, thanks for the help!

1 Like

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!

1 Like