Migration Guide
This page covers migration from pickle and JSON to pyfory.
From Pickle
Replace pickle with Fory for better performance while keeping the same API:
# Before (pickle)
import pickle
data = pickle.dumps(obj)
result = pickle.loads(data)
# After (Fory - drop-in replacement with better performance)
import pyfory
f = pyfory.Fory(xlang=False, ref=True, strict=False)
data = f.dumps(obj) # Faster and more compact
result = f.loads(data) # Faster deserialization
# Benefits:
# - 2-10x faster serialization
# - 2-5x faster deserialization
# - Up to 3x smaller data size
# - Same API, better performance