[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-12-16 Thread Josh Rosenberg
Josh Rosenberg added the comment: Even if making a copy is necessary when the underlying function receives the dict "raw", preemptively performing the copy (before knowing if the function being called is a Vectorcall function) means that when it's a Vectorcall function (e.g. all user-defined

[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-10-15 Thread Josh Rosenberg
Change by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: $ python3.8 -m timeit -s "a = {'a': 1}" "dict(**a)" 200 loops, best of 5: 113 nsec per loop $ python3.9 -m timeit -s "a = {'a': 1}" "dict(**a)" 200 loops, best of 5: 181 nsec per loop -- nosy: +serhiy.storchaka __

[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-10-15 Thread Brandt Bucher
Change by Brandt Bucher : -- nosy: +brandtbucher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-10-15 Thread Xavier Morel
Xavier Morel added the comment: I have not noticed anything, I was just looking at the bytecode changes and stumbled upon this oddity. Though I would expect a small slowdown as every fn(**kw) would now incur an extra dict copy, unless there’s something in call_function_ex which copies the inp

[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-10-15 Thread Mark Shannon
Mark Shannon added the comment: Have you observed any slowdown or incorrect behaviour? The 3.8 bytecode looks incorrect to me. The C-API documentation doesn't prohibit callables from mutating the dictionary they receive. Unless a copy is made, then a callee could mutate `var`. https://docs.p

[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-10-15 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> Mark.Shannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-10-14 Thread Xavier Morel
New submission from Xavier Morel : Following bpo-39320 the highly specialised bytecode for vararg calls were replaced by simpler ones, but there seems to be at least one area where the generated bytecode regressed for possibly no reason? In Python 3.8, foo(**var) compiles to: 0 LOAD_GLOBAL