On Fri, Jun 27, 2014 at 10:05 AM, Skip Montanaro <s...@pobox.com> wrote: > On Fri, Jun 27, 2014 at 10:55 AM, Mark Lawrence <breamore...@yahoo.co.uk> > wrote: >> Expectations don't count, measure it :) > > It's no contest. I have measured it (ages ago). The logging module > does so many things that it's impossible for it to ever be as fast as > a simple print statement. Look at the code in LogRecord.__init__. Then > note the doc string: > > ... LogRecord instances are created every time something is logged. ...
While I'm not disputing your measurement, doesn't the logging module delegate the actual I/O to a separate thread? That's got to count for something, compared to a raw print that has to wait for the I/O to finish. -- https://mail.python.org/mailman/listinfo/python-list