Jump to content
nolanmaris

Handling Large JSON Responses Efficiently in Delphi

Recommended Posts

Hello

 

When working with REST APIs in Delphi; I often encounter large JSON responses that can slow down processing & even cause memory issues. Parsing such responses using TJSONObject or TJSONParser sometimes results in performance bottlenecks, especially when handling deeply nested structures or high-volume data from services like Amazon or Google APIs.😇

 

I’m looking for the best way to handle these large JSON responses efficiently. Would streaming the JSON instead of loading it all at once be a better approach? Are there lightweight libraries or techniques that help optimize performance while keeping memory usage low?  🤔Additionally, how can I extract only the needed data from a large JSON response without parsing the entire object?🤔

If anyone has experience dealing with similar issues, I’d love to hear about recommended practices.

 

 

 

Thank you !!🙂

Share this post


Link to post

Some databases support JSON tables where you can insert JSON strings and query them with normal SQL and is VERY fast.

Google for example "MSSQL database JSON"

 

>>Additionally, how can I extract only the needed data from a large JSON response without parsing the entire object?

You can exactly do this with the database, because you have to create a kind of mapping to use the SQL and you can map only the fields that you need..

Edited by Die Holländer

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×