I'm going to write a parser for a log file where each line is one JSON record.
I could decode each line in a loop:
logs = [json.loads(line) for line in lines]
or I could decode the whole file in one go:
logs = json.loads('[' + ','.join(lines) + ']')
I want to minimize the execution time, please disregard other factors. Is there any reason to prefer one approach over the other?