Why is reading and calling an API from a file slower using Python async than synchronously?
问题 I have a large file, with a JSON record on each line. I'm writing a script to upload a subset of these records to CouchDB via the API, and experimenting with different approaches to see what works the fastest. Here's what I've found to work fastest to slowest (on a CouchDB instance on my localhost): Read each needed record into memory. After all records are in memory, generate an upload coroutine for each record, and gather/run all the coroutines at once Synchronously read file and when a