Skip to content

Performance comparison of JSONDecoder and JSONSerializaton.

Notifications You must be signed in to change notification settings

quanvo87/jsonPerf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsonPerf

Performance comparison of JSONDecoder and JSONSerializaton decoding and returning a struct from a 7 MB JSON.

macOS

macOS: JSONEncoder was 10.95% slower than JSONSerialization + object mapping.

Linux

Linux: JSONEncoder was 0.28% faster than JSONSerialization + object mapping.

Notes

The JSONEncoder bars show performance of decoder.decode() where decoder is a previously instantiated JSONDecoder.

The JSONSerialization bars show the total performance of JSONSerialization.jsonObject, a cast of that return value to [String: Any], and then instantiating a struct from that dictionary.

Credits

Borrowed ideas from JSONShootout. Also using their large JSON file.

About

Performance comparison of JSONDecoder and JSONSerializaton.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages