Re: [Python-Dev] Add a developer mode to Python: -X dev command line option

2017年11月16日 06:51:03 -0800

On Thu, Nov 16, 2017 at 7:56 AM, Victor Stinner
<[email protected]> wrote:
> 2017年11月16日 13:43 GMT+01:00 Antoine Pitrou <[email protected]>:
>>> About asyncio debug mode, if it's too expensive to be used to develop
>>> an application, maybe there is an issue with additional checks? Should
>>> we remove some of them to be able to use asyncio debug mode in more
>>> cases?
>>
>> Well, I'm sure some people like them, otherwise they wouldn't have been
>> added to the codebase in the first place :-) For example, knowing where
>> a Future was created can make debug logs much more informative.
>
> The most expensive part of asyncio debug mode is the code to extracts
> the current stack when a coroutine or a handle is created.
Probably the most expensive part of asyncio debug mode is all
coroutines wrapped with CoroWrapper. This makes every "await" and
coroutine instantiation much slower (think 2-3x).
> Would it make sense to modify asyncio debug mode to skip the traceback
> by default, but add a second debug level which extracts the traceback?
Let's keep it simple. I'm big -1 on adding different "debug levels",
they are always confusing.
Overall I don't see an issue with enabling asyncio debug mode when
python is executed with "-X dev". If the purpose of the flag is to
make Python super verbose and it will not be recommended to use it in
production -- then why not.
Yury
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to