[pypy-commit] pypy reflex-support: go back to a cppyy demo

cfbolz noreply at buildbot.pypy.org
Mon Jul 11 17:54:21 CEST 2011


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: reflex-support
Changeset: r45458:309c775aacde
Date: 2011-07-11 15:58 +0200
http://bitbucket.org/pypy/pypy/changeset/309c775aacde/

Log:	go back to a cppyy demo

diff --git a/pypy/jit/tl/pypyjit_demo.py b/pypy/jit/tl/pypyjit_demo.py
--- a/pypy/jit/tl/pypyjit_demo.py
+++ b/pypy/jit/tl/pypyjit_demo.py
@@ -1,11 +1,14 @@
+import cppyy
 
-try:
-    import numpy
-    a = numpy.array(range(10))
-    b = a + a + a
-    print b[3]
+import time
+import cppyy
+lib = cppyy.load_lib("../../module/cppyy/test/example01Dict.so")
+cls = cppyy._type_byname('example01')
+inst = cls.construct(-17)
 
-except Exception, e:
-    print "Exception: ", type(e)
-    print e
-
+t1 = time.time()
+res = 0
+for i in range(10):
+    res += inst.invoke("addDataToInt", i)
+t2 = time.time()
+print t2 - t1


More information about the pypy-commit mailing list