Re: [Python-Dev] Benchmarks why we need PEP 576/579/580
On 2018-07-22 08:27, INADA Naoki wrote:
It's interesting... But I failed to build sage.
What went wrong?
It's build step is too different from normal Python package.
That's true because Sage considers itself a distribution rather than a package. But it's possible to pick the distribution apart and build just the Python package "sage". In fact, various Linux distros package Sage that way. The reason for it being a distribution is mainly that it has a huge number of dependencies (many of them not Python), so it wouldn't be possible to do "pip install sage" anyway.
It tooks very long time to build.
That's just a matter of waiting a few hours.
And "install from source" document only describe step to `./sage` command work. It doesn't describe step to `improt sage` works.
Those two are pretty much equivalent. If you really want just the latter, you can run "make sageruntime" in the Sage root.
Target application should be easy to test, benchmark and profile for all of core-devs interesting in these PEPs.
I feel like the bar for this PEP is being raised all the time. First, you ask for an application benchmark and I provided an application benchmark. Now you complain that my application is not suitable. Why don't you just believe my timings? Jeroen.
On Sun, Jul 22, 2018 at 7:42 PM Jeroen Demeyer
On 2018-07-22 08:27, INADA Naoki wrote:
It's interesting... But I failed to build sage.
What went wrong?
I can't install Sage into my virtual environment, so I can't run
python -m timeit -s "from sage.all import MatrixSpace, GF; M = MatrixSpace(GF(9), 200).random_element()" "M * M"
But I can run it finally, with `sage -python` command.
And I
profiled what is the bottleneck of this oneliner.
https://gist.github.com/methane/91533f68e88f89b7ec7f71855c069792
Cython does optimizations like CPython does internally.
When calling function with one arg, and if the function is PyCFunction,
Cython call underlaying C function directly.
cfunc = PyCFunction_GET_FUNCTION(func);
self = PyCFunction_GET_SELF(func);
result = cfunc(self, arg);
This is why such regression happened on even Python 2.7.
And I think I can write small benchmark emulate it for now.
--
INADA Naoki
participants (2)
-
INADA Naoki
-
Jeroen Demeyer