Accidentally imported build products.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12450 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Stefan Zager 2011-02-10 05:17:31 +00:00
commit 3852ca8f44
14 changed files with 1 additions and 6908 deletions

View file

@ -10,7 +10,7 @@ else
PYSCRIPT = runme3.py
endif
SUBDIRS := constructor func deep_hierarchy
SUBDIRS := constructor func hierarchy operator
default : all

View file

@ -0,0 +1,23 @@
TOP = ../../..
SWIG = $(TOP)/../preinst-swig
CXXSRCS =
TARGET = Simple
INTERFACE = Simple.i
default : all
all :
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -module Simple_baseline' \
TARGET='$(TARGET)_baseline' INTERFACE='$(INTERFACE)' python_cpp
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -O -module Simple_optimized' \
TARGET='$(TARGET)_optimized' INTERFACE='$(INTERFACE)' python_cpp
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -builtin -O -module Simple_builtin' \
TARGET='$(TARGET)_builtin' INTERFACE='$(INTERFACE)' python_cpp
static :
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static
clean :
$(MAKE) -f $(TOP)/Makefile python_clean
rm -f $(TARGET).py

View file

@ -0,0 +1,52 @@
%inline %{
class A {
public:
A () {}
~A () {}
void func () {}
};
class B : public A {
public:
B () {}
~B () {}
};
class C : public B {
public:
C () {}
~C () {}
};
class D : public C {
public:
D () {}
~D () {}
};
class E : public D {
public:
E () {}
~E () {}
};
class F : public E {
public:
F () {}
~F () {}
};
class G : public F {
public:
G () {}
~G () {}
};
class H : public G {
public:
H () {}
~H () {}
};
%}

View file

@ -79,7 +79,6 @@ class A(_object):
__swig_destroy__ = _Simple_baseline.delete_A
__del__ = lambda self : None;
def func(self): return _Simple_baseline.A_func(self)
def __iadd__(self, *args): return _Simple_baseline.A___iadd__(self, *args)
A_swigregister = _Simple_baseline.A_swigregister
A_swigregister(A)

View file

@ -86,7 +86,6 @@ class A(object):
_Simple_optimized.A_swiginit(self,_Simple_optimized.new_A())
__swig_destroy__ = _Simple_optimized.delete_A
A.func = new_instancemethod(_Simple_optimized.A_func,None,A)
A.__iadd__ = new_instancemethod(_Simple_optimized.A___iadd__,None,A)
A_swigregister = _Simple_optimized.A_swigregister
A_swigregister(A)

View file

@ -0,0 +1,17 @@
#!/usr/bin/env
import sys
from subprocess import *
proc = Popen([sys.executable, 'runme_baseline.py'], stdout=PIPE)
(stdout, stderr) = proc.communicate()
print stdout
proc = Popen([sys.executable, 'runme_optimized.py'], stdout=PIPE)
(stdout, stderr) = proc.communicate()
print stdout
proc = Popen([sys.executable, 'runme_builtin.py'], stdout=PIPE)
(stdout, stderr) = proc.communicate()
print stdout

View file

@ -0,0 +1,11 @@
#!/usr/bin/env python
import Simple_baseline
import time
t1 = time.clock()
x = Simple_baseline.H()
for i in range(10000000) :
x.func()
t2 = time.clock()
print "Simple_baseline took %f seconds" % (t2 - t1)

View file

@ -0,0 +1,11 @@
#!/usr/bin/env python
import Simple_builtin
import time
t1 = time.clock()
x = Simple_builtin.H()
for i in range(10000000) :
x.func()
t2 = time.clock()
print "Simple_builtin took %f seconds" % (t2 - t1)

View file

@ -0,0 +1,11 @@
#!/usr/bin/env python
import Simple_optimized
import time
t1 = time.clock()
x = Simple_optimized.H()
for i in range(10000000) :
x.func()
t2 = time.clock()
print "Simple_optimized took %f seconds" % (t2 - t1)

File diff suppressed because it is too large Load diff