On Thu, Jun 27, 2019 at 12:23:24PM -0400, nate lust wrote:

> If you have a
> bench mark you prefer I would be happy to run it against my changes and
> mainline python 3.7 to see how they compare.

Ultimately it will probably need to run against this:

https://github.com/python/pyperformance

for 3.8 and 3.9 alpha but we can start with some quick and dirty tests 
using timeit. Let's say:


def test():
    n = 0
    def inner():
        global g
        nonlocal n
        n = g
        x = n
        g = x
        y = x
        z = y
        return x
    for i in range(100):
        a = inner()

from timeit import Timer
t = Timer("test()", setup="from __main__ import test; g=0")
t.repeat(repeat=5)


I'm not speaking officially, but I would say that if this slows down 
regular assignments by more than 5%, the idea is dead in the water; if 
it slows it down by less than 1%, the performance objection is 
satisfied; between 1 and 5 means we get to argue cost versus benefit.

(The above is just my opinion. Others may disagree.)


-- 
Steven
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/SJBOCUI22E36XSIDQBD5GYLATBJRVLIX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to