Monday, 27 August 2018

JSON vs Pickle when passing data between processes

I have two processes in Python that need to communicate data. That data is usually of the sort of dictionaries, lists, and so (just like the data that JSON would allow). For this last reason, I have though about either using JSON strings and loading and dumping the data in each side, or doing the same with pickle.

Processes are able to send each other strings or bytes.

W̶h̶i̶c̶h̶ ̶w̶o̶u̶l̶d̶ ̶b̶e̶ ̶m̶o̶r̶e̶ ̶r̶e̶c̶o̶m̶m̶e̶n̶d̶a̶b̶l̶e̶?̶ What are the main pros and cons of each tool (in terms of speed, fexibility, etc), so one (and I) can decide which suits them best?



from JSON vs Pickle when passing data between processes

No comments:

Post a Comment