[Stackless] Slowdown when running Numpy with Stackless?

Bin Huang bin.arthur at gmail.com
Tue May 7 04:40:15 CEST 2013


Richard,

Do you mind telling me the right way to compile stackless Python with
STACKLESS_OFF defined? I tried but I was out of luck.

Here is what I did. I downloaded Stackless Python 2.7.2 tar ball and made
sure I had a fresh start. Then I modified Stackless/stackless.h and changed
it from

#define STACKLESS
to
#define STACKLESS_OFF

When I compiled the code, I had error like:

*gcc -pthread -c -fno-strict-aliasing -DSTACKLESS_FRHACK=0 -g -O2 -DNDEBUG
-g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include
-I./Stackless   -DPy_BUILD_CORE -o Objects/descrobject.o
Objects/descrobject.c*
*Objects/descrobject.c: In function 'methoddescr_call':*
*Objects/descrobject.c:213:5: warning: variable 'stackless' set but not
used [-Wunused-but-set-variable]*
*Objects/descrobject.c: In function 'classmethoddescr_call':*
*Objects/descrobject.c:261:5: warning: variable 'stackless' set but not
used [-Wunused-but-set-variable]*
*Objects/descrobject.c: In function 'wrapperdescr_call':*
*Objects/descrobject.c:278:5: warning: variable 'stackless' set but not
used [-Wunused-but-set-variable]*
*Objects/descrobject.c: At top level:*
*Objects/descrobject.c:486:14: error: static declaration of
'PyMemberDescr_Type' follows non-static declaration*
*Include/descrobject.h:79:26: note: previous declaration of
'PyMemberDescr_Type' was here*
*Objects/descrobject.c:526:14: error: static declaration of
'PyGetSetDescr_Type' follows non-static declaration*
*Include/descrobject.h:78:26: note: previous declaration of
'PyGetSetDescr_Type' was here*
*Objects/descrobject.c: In function 'wrapper_call':*
*Objects/descrobject.c:1012:5: warning: variable 'stackless' set but not
used [-Wunused-but-set-variable]*
*make: *** [Objects/descrobject.o] Error 1*

I have searched the error message in google and someone said that the
problem could be solved by simply getting rid of the "static" declaration
in the source code. Does this make sense?

Bin

On Sun, May 5, 2013 at 4:16 PM, Richard Tew <richard.m.tew at gmail.com> wrote:

> On Sun, May 5, 2013 at 2:57 PM, Bin Huang <bin.arthur at gmail.com> wrote:
> > I have observed slowdown when running Numpy with Stackless compared to
> > running it with CPython. The slowdown can be significant when problem
> size
> > is large. I wish someone in this mailing list can give me some hints on
> this
> > issue. I also post performance results and my source code here.
> >
> > My platform is a 12-core dual-socket SMP machine running Ubuntu (Linux
> > kernel 3.2.0). On this platform, I have CPython 2.7.3, Numpy 1.6.1, and
> > Stackless Python 2.7.2 installed.
> > ...
> > Any ideas? Thanks in advance.
>
> As it stands, you have tested with different versions of Python and
> Stackless, and both should be using different lib directories.  There
> are too many variables, where the problem may lie with your
> installations.  Or perhaps whatever packages you sourced them from.
>
> This can be easily tested.  If you compile Stackless Python with
> STACKLESS_OFF defined, it should compile as normal Python of the same
> version (e.g. 2.7.2 or 2.7.3).
>
> So do the following:
> 1) Obtain the source code for Stackless Python 2.7.2 tarball release,
> compile it, install numpy local to it and execute your test.
> 2) Then take the same source code in a different directory, compile it
> with STACKLESS_OFF defined (which should compile to just normal Python
> of the same version), install numpy local to it and execute your test.
>
> And if you really want to be certain that things line up:
> 3) Obtain the source code for official Python 2.7.2 tarball release.
> Repeat the test process.
>
> All should be the same.  If Stackless differs as shown in your tests,
> then the problem undeniably lies with Stackless.
>
> Hope this helps,
> Richard.
>
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20130506/19e072f1/attachment.html>


More information about the Stackless mailing list