<div dir="ltr">Thread safety is not a problem here because of the GIL.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Sa., 9. März 2019 um 02:03 Uhr schrieb Greg Ewing <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Martin Bammer wrote:<br>
<br>
> what about the idea that the interpreter preallocates and preinitializes <br>
> the tuples and dicts for function calls where possible when loading a module?<br>
<br>
This would not be thread-safe. Locking would be needed around uses<br>
of the preallocated objects, and that might take away some or all<br>
of the gain. It would also introduce unexpected interactions<br>
between threads.<br>
<br>
-- <br>
Greg<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</blockquote></div>