Showing content from http://mail.python.org/pipermail/python-dev/attachments/20160809/82173b1a/attachment.html below:
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 9 August 2016 at 23:26, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On 9 August 2016 at 06:18, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I think Nick would be interested in understanding why this is the case. What does the decorator do that could be so expensive?<br></div></blockquote><div><br></div></span><div>Reviewing <a href="https://hg.python.org/cpython/file/default/Lib/contextlib.py#l57" target="_blank">https://hg.python.org/cpython/<wbr>file/default/Lib/contextlib.<wbr>py#l57</a>, Chris's analysis seems plausible to me</div></div></div></div></blockquote><div><br></div><div>Sorry Wolfgang - I missed that Chris was expanding on a comparison you initially made!<br><br>Either way, I agree that aspect does make up the bulk of the difference in speed, so moving to C likely wouldn't help much. However, the speed difference relative to the simpler warppers is far less defensible - I think there are some opportunities for improvement there, especially around moving introspection work out of _GeneratorContextManager.__init__ and into the contextmanager decorator itself.<br><br></div><div>Cheers,<br></div><div>Nick.<br></div></div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Nick Coghlan  |  <a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>  |  Brisbane, Australia</div>
</div></div>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4