URLSession performance for reading a byte stream
What’s the best way to read a stream of bytes with URLSession? That’s the simple question I set out to answer. I wrote some benchmarks. They read a 128 MiB file and perform a contrived aggregation of its content bytes (a joking “hash” of them, merely to ensure the actual reads aren’t optimised out).
⚠️ In a nutshell, the results here demonstrate the best-case performance for each of the […]
https://wadetregaskis.com/urlsession-performance-for-reading-a-byte-stream/
I think I have seen enough pain points with plain #URLSession now to appropriately appreciate the comforts of #Alamofire.
I try to keep my dependencies down where I can, but I really don't feel like reinventing retry logic, network error handling and session management.
#iOS #Swift
I've been slowly refactoring my network code to move to a newer backend,, and in the process I moved the client code from using the Moya lib to basic URLSession. Moya has been great and works well, but it's not being updated anymore and has no async/await support. Anyway, as I last night removed the last of the Moya code the logging disappeared! So Moya was doing something to trigger the internal network logging and now it's gone. Logging bliss again!