[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-05 Thread Zach Byrne
Zach Byrne added the comment: I'm attaching output from a selection of the benchmarks, I'm counting non-builtins and slices, but for everything, not just lists and tuples. Quick observation: math workloads seem list heavy, text workloads seem dict heavy, and tuples are usually somewhere in

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: The test suite is not an appropriate workload to run benchmarks or statistics. Can you run with the benchmarks suite instead? -- ___ Python tracker

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: I also suggest counting the number of BINARY_SUBSCR calls that are *not* one of the builtin types under consideration. Also, it would be good to distinguish slicing from integer indexing, for lists and tuples. --

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I'm pretty sure that optimizing lists (and tuples?) is a great idea. I think it's a good idea indeed. > It would also be nice to optimize [-1] lookup How is that different from the above? :) -- nosy: +pitrou ___

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-04 Thread Zach Byrne
Zach Byrne added the comment: Ok, I've started on the instrumenting, thanks for that head start, that would have taken me a while to figure out where to call the stats dump function from. Fun fact: BINARY_SUBSCR is called 717 starting python. --

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-04 Thread Yury Selivanov
Yury Selivanov added the comment: Looks like we want to specialize it for lists, tuples, and dicts; as expected. Not so sure about [-1, but I suggest to benchmark it anyways ;) -- ___ Python tracker

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Looks as statistics varies from test to test too much. Could you please collect the statistics for running all tests? -- ___ Python tracker

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-04 Thread Zach Byrne
Zach Byrne added the comment: I'll put together something comprehensive in a bit, but here's a quick preview: $ ./python Python 3.6.0a0 (default, Feb 4 2016, 20:08:03) [GCC 4.6.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> exit() Total BINARY_SUBSCR

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-04 Thread Zach Byrne
Zach Byrne added the comment: One thing I forgot to do was count slices. -- ___ Python tracker ___ ___

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: Zach, first I was going to collect some stats on this (as Serhiy also suggests). It would be interesting to collect some stats on how many times BINARY_SUBSCR receives lists, tuples, dicts, and other types. I'd instrument the code to collect those stats and

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: Zach, BTW, you can see how I instrumented ceval for stats collection in the patch for issue #26219. That's only for the research purposes, we won't commit that... or maybe we will, but in a separate issue :). --

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-03 Thread Zach Byrne
Zach Byrne added the comment: Yury, Are you going to tackle this one, or would you like me to? -- ___ Python tracker ___

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Would be nice to collect statistics about arguments types during running the testsuite. May be list is not the most popular type of collection. -- nosy: +serhiy.storchaka ___ Python tracker

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-03 Thread Yury Selivanov
New submission from Yury Selivanov: See also issue #21955 -- components: Interpreter Core messages: 259492 nosy: haypo, yselivanov, zbyrne priority: normal severity: normal stage: needs patch status: open title: ceval: Optimize [] operation similarly to CPython 2.7 type: performance