-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 25/03/12 11:28, Larry Brasfield wrote:
> Please forgive a bit of skepticism here.  Do you mean that the
> amalgamation of sqlite3.c into apsw.c provides a 10% speed advantage?

Yes.  Effectively the point of APSW is to provide a Pythonic API, extract
parameters and then call the SQLite API.  When the APSW code and SQLite
code are in the same translation unit then a lot of inlining happens which
is more efficient - it is a lot of fun doing debugging.

> I had no idea that such linkages could reach across DLL boundaries.

If APSW had the SQLite symbols visible then later loading DLLs can end up
using those symbols instead of from some other SQLite such as the system
libraries.

>> Consequently the single best thing to do is include the SQLite 
>> amalgamation statically as it is far more robust.
> 
> So, the choice is between courting compile-time name collisions and
> risking run-time name collisions.

APSW is a Python extension and hence a shared library.  You won't see
collisions at compile time.  And you won't see collisions at runtime either.

An example of the inverse happening is on Mac.  Setting load paths etc is
completely ignored and the system SQLite always used.  This is usually an
older version and will cause grief.

> FYI, I'm having difficulty getting windows.h from the v7.0A Windows SDK
> and the VS10 Express edition of the standard C headers to coexist with
> the headers in Python 2.7.

You need to use Visual Studio 2008 to compile Python extensions on
Windows.  Each release of Visual Studio includes a new C runtime library
which is binary incompatible with other releases.  Additionally you can
only use one version of the CRT in a process at a time.  Most current
versions of Python on Windows are compiled with VS2008 so the extensions
have to be compiled with the same version.  These are the hoops I jump
through to setup a Windows compilation system:

   http://code.google.com/p/apsw/wiki/Win7build

> In particular, I cannot compile apsw.c whether WINDOWS_LEAN_AND_MEAN is
> defined or not.  (I am not asking for help with this.  I just imagine
> you could be interested.)

The solution being used to #undef small which is less intrusive.  SQLite
keeps getting deeper and deeper hooks in the VFS so I'd expect some point
in the future that the full fat version of Windows.h will be needed.

> As I stated, windows.h violated one of the conventions

It also dates from the early 80s so I don't really fault Microsoft
employees for not having a time machine.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk9vfH4ACgkQmOOfHg372QS8wACeI/MSXOopVGOzzusymU2x1nXD
I5IAn2KIgHSgUSUepB7lGOsjsubu2lA8
=MGb2
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to