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

Adding JsonConverter::chunkSize #540

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

nyamsprod
Copy link
Member

public JsonConverter::chunkSize(int $chunkSize): self

This method sets the number of rows to buffer before calling the json_encode function. This allow for faster conversion while retaining the low memory usage. Of course, the optimal chunk size will vary depending on the use case.

By default, the value is 500.

The value can not be lower than 1 otherwise a exception will be thrown.

@nyamsprod nyamsprod self-assigned this Oct 10, 2024
@nyamsprod nyamsprod force-pushed the feature/adding-jsonconverter-chunksize branch from 2784514 to e7276ba Compare October 10, 2024 21:06
@nyamsprod nyamsprod force-pushed the feature/adding-jsonconverter-chunksize branch from e7276ba to 2116b91 Compare October 10, 2024 21:07
@nyamsprod nyamsprod merged commit b4583da into master Oct 10, 2024
17 checks passed
@nyamsprod nyamsprod deleted the feature/adding-jsonconverter-chunksize branch October 10, 2024 21:09
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.

1 participant