On Sat, 14 Mar 2015 11:02:00 -0700
Jerry Cen <zhiw...@google.com> wrote:

> Please use the following instead. There was a bug in the previous patch.
> 
> 
> 
> Signed-off-by: Jerry Cen <zhiw...@google.com>
> Author: Mark Lentczner <mz...@google.com>
> Date: Fri, 13 Mar 2015 12:02:15 -0700
> Subject: [PATCH] Reduce logging overhead by cleaning up logging calls
> 
> Deferred formatting to the logging system:
> ---------------------------------------------
> In general
>     logger.debug('xxx %s yyy %d zzz' % (a, b, c))
> can be written as:
>     logger.debug('xxx %s yyy %d %zzz', a, b, c)
> This is faster, as Python logging doesn't bother doing the format
> operation (which is slow) if the log message won't be logged.
> 
> We measured that a significant amount of CPU time in the BGP service
> was attributable to these formatting operations.
> 
> Removed unneeded calls to str() and repr()
> ------------------------------------------
> since formatting operations %s and %r will make these calls when
> (and if) the formatting is performed.

Great, thanks a lot!

Seems that the patch is malformed (long lines are folded) so I fixed
by hand. Hopefully, I didn't mess up anything:

https://github.com/osrg/ryu/commit/b636219007153c5fa9e7910c0b1cf27004dcae05

I fixed some pep8 warnings too:

https://github.com/osrg/ryu/commit/f10f4f7cfd48327b60b4423cddf4066cc069a6d0

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to