-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optimization option #1
Comments
I was referring to usability but performance is a good question. I haven't come across any complaints on the builtin loggers' performance. But if you know of any, please share.
Not a fair comparison. Twisted's logger is
Interesting project. The only issue I have is that it departs too far from the builtin logging API. My project aims to be fully compatible with the builtin logger, so no need to learn a completely new API. |
The first two relevant links of my Google query - http://dound.com/2010/02/python-logging-performance/ - 25% boost in performance after stripping logging calls. https://stackoverflow.com/questions/522730/how-can-i-strip-python-logging-calls-without-commenting-them-out
I can't say that I've learned the old API - every time I need it, I go into docs or copy/paste it from other project. But Eliot nesting makes it indeed a little bit obtrusive. I'd prefer more decoupled framework. Maybe something over https://github.com/lihaoyi/macropy |
Your first link deals with creating expensive logging messages which is not necessarily a fault of the logging module. But it is quite common and has an easy fix: logging.Logger.isEnabledFor
That does bring up a good point though. It would be nice to add an option that will do this for you automatically. The other link about tight loops is similarly answered:
|
logging
isn't broken? What about performance at least?
But also it would be nice to have some performance benchmarks, so maybe in future |
Also, a fair comparison to Twisted approach will add more points to the library as it will give people choice to either choose API that comes from standard library, or consider another approach, which in both turns allows them to write code better. |
Just added a new issue to reflect this. I don' t have much experience writing perf tests so feel to send a PR :)
Agreed. When I get around to adding async, I will show how it compares to twisted. My plan is to stick to the standard API as closely as possible and transparently translate it to the async implementation. I'd also plan to make the async backend pluggable so a user could go with tornado or asyncio if he/she prefers. |
Hmm.. Do you have any performance benchmarks that prove that logging is really isn't broken in terms of performance?
It
logging
wasn't broken then I suppose there won't be such things as https://twistedmatrix.com/documents/15.2.1/core/howto/logger.htmlWhich also says that:
As for
don't reinvent the wheel
here is a good example of "logging with superpowers". https://eliot.readthedocs.org/en/0.11.0/index.html =)The text was updated successfully, but these errors were encountered: