Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit719b4d3

Browse files
committed
[Serializer] [JsonStreamer] Add streaming JSON documentation
1 parent5147f15 commit719b4d3

File tree

2 files changed

+704
-0
lines changed

2 files changed

+704
-0
lines changed

‎serializer.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,38 @@ all the properties of the class::
629629
// ...
630630
}
631631

632+
Serializing JSON using streams
633+
------------------------------
634+
635+
Symfony is able of encoding PHP data structures to JSON streams and decoding
636+
JSON streams back into PHP data structures.
637+
638+
To do so, it relies on the JsonStreamer component, which is designed for high
639+
efficiency and can process large JSON data incrementally without needing to
640+
load the entire content into memory.
641+
642+
When deciding between the:doc:`Serializer component<serializer>` and the
643+
JsonStreamer component, consider the following:
644+
645+
- **Serializer Component**: Ideal for scenarios requiring flexibility, such as
646+
dynamically manipulating object shapes using normalizers and denormalizers,
647+
or handling complex objects which multiple serialization representation.
648+
Plus, it allows working with formats beyond JSON (and even with a custom
649+
format of yours).
650+
651+
- **JsonStreamer Component**: Ideal for simple objects and tasks that
652+
demand high performance and minimal memory usage. It's particularly
653+
effective when processing very large JSON datasets or in scenarios that
654+
require streaming JSON in real-time without loading the entire dataset
655+
into memory.
656+
657+
Choosing between the two depends on your specific use case requirements.
658+
The JsonStreamer component is tailored to optimize for performance and memory
659+
efficiency, while the Serializer component offers flexibility and broader
660+
format support.
661+
662+
Read more about streaming JSON in:doc:`/serializer/streaming_json`.
663+
632664
Serializing to or from PHP Arrays
633665
---------------------------------
634666

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp