Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HttpFoundation] Add StreamedJsonResponse for efficient JSON streaming #47709

Open
wants to merge 9 commits into
base: 6.2
Choose a base branch
from

Conversation

alexander-schranz
Copy link
Contributor

@alexander-schranz alexander-schranz commented Sep 27, 2022

Q A
Branch? 6.2
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #...
License MIT
Doc PR symfony/symfony-docs#...

When big data are streamed via JSON API it can sometimes be difficult to keep the resources usages low. For this I experimented with a different way of streaming data for JSON responses. It uses combination of structured array and generics which did result in a lot better result.

More can be read about here: https://github.com/alexander-schranz/efficient-json-streaming-with-symfony-doctrine.

I thought it maybe can be a great addition to Symfony itself to make this kind of responses easier and that APIs can be made more performant.

@carsonbot carsonbot changed the title Add StreamedJsonResponse for efficient JSON streaming [HttpFoundation] Add StreamedJsonResponse for efficient JSON streaming Sep 27, 2022
@alexander-schranz
Copy link
Contributor Author

alexander-schranz commented Sep 27, 2022

The error in the tests of Stopwatch is unrelated to the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants