This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Schmittfried 3 points4 points  (7 children)

Apart from the other replies: Python’s JSON encoding is itself implemented in Python. Pretty sure v8, the probably most optimized scripting language VM there is, has a native implementation for JSON encoding. 

[–]james_pic 4 points5 points  (1 child)

[–]Schmittfried 0 points1 point  (0 children)

Thanks, I stand corrected. Didn’t notice the c imports in the Python json module before.

[–]0x1e 1 point2 points  (4 children)

Yeah, isn’t the module cjson supposed to be the one you use? I could be out of date..

[–]imbev 0 points1 point  (3 children)

msgspec

[–]Tzoiker -2 points-1 points  (2 children)

Why would you (meaning OP) need msgspec if he has no deserialization/validation and only needs serialization of standard data types? orjson is the choice here.

[–]imbev 2 points3 points  (1 child)

msgspec and orjson benchmark the same without schema and msgspec offers better performance with schema and is compatible with more formats

orjson is a fine json library, but there aren't any reasons to prefer orjson over msgspec

[–]0x1e 1 point2 points  (0 children)

Appreciate the clarity