-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm trying to port my APSW C extension to pypy and am encountering various issues. APSW is somewhat similar to pysqlite in that it wraps SQLite, but APSW wraps all of SQLite and provides SQLite's semantics rather than whatever DBAPI says. APSW supports Python 2.3 through 3.2.
What is the correct way to detect pypy compilation? My code includes various enhancements and optimisations but they depend on CPython to some degree. These would need to be disabled at compile time. It looks like PYPY_VERSION being #defined will work but I'd rather use the "official" way whatever that is. One example optimisation I do is object reuse. When the refcount is 1 and it is dealloc then they go to a recycle list. Doing this gave several percentage point performance improvements. This can be disabled with a #define. An example of enhanced functionality is an alternative to PyErr_WriteUnraiseable. The CPython implementation is virtually useless (eg no traceback). My version shows the traceback but again depends on CPython internals to get it. http://code.google.com/p/apsw/source/browse/src/util.c#89 I need the api PyRun_StringFlags as it is used to execute a Python string and attach the results to the module. It is called like this: PyRun_StringFlags(char*, Py_file_input, apswdict, apswdict, NULL); I do have a benchmarking tool that mainly exposes the performance improvement of APSW over pysqlite. Most of the work of the wrapper is taking Python types (especially strings) and providing them to the SQLite APIs, and getting data back from SQLite and converting back to Python types. There is a lot of GIL acquisition and release. In order to improve performance there are also various string related caches. My test suite has 99,6% coverage of the C code so I should be able to find all the places where pypy differs. Roger -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk29JHMACgkQmOOfHg372QSTSQCgu3mi8osgcXgpcQ0SpMTJvnVu 7BQAoIxIZsaeq29QCqrJdFRarnvpjay0 =BZfM -----END PGP SIGNATURE----- _______________________________________________ pypy-dev@codespeak.net http://codespeak.net/mailman/listinfo/pypy-dev