|
5498 | 5498 | "source": [ |
5499 | 5499 | "Things to think about, besides speed:\n", |
5500 | 5500 | "\n", |
5501 | | - "* Maintainability \n", |
5502 | | - "* Compiler dependency \n", |
5503 | | - "* Suseptability to bugs (object lifetimes, signature mismatches) \n", |
| 5501 | + "* Maintainability\n", |
| 5502 | + " - What happens when the C code changes?\n", |
| 5503 | + "* Compiler dependency\n", |
| 5504 | + " - ctypes needs none, CFFI has two modes, Cython requires one\n", |
| 5505 | + "* Suseptability to bugs (object lifetimes, signature mismatches)\n", |
| 5506 | + " - All use a minilanguage for interfacting, only CFFI's is standard C\n", |
| 5507 | + " - Cython will handle most transformations automatically\n", |
| 5508 | + " - CFFI can be tricky for C-level pointers\n", |
| 5509 | + "* Speed and productivity\n", |
| 5510 | + " - Cython is heavily optimized, tightly integrated to the C-API\n", |
| 5511 | + " - If the headers are pure C, CFFI should be simple\n", |
| 5512 | + " - Projects exist to generate wrappers for all three\n", |
5504 | 5513 | "* Which technology is actively maintained (ctypes went into the stdlib to die?)\n", |
5505 | 5514 | "\n", |
5506 | 5515 | "And now the pop-quiz. If we run the pure python version in PyPy what time will we get?:\n", |
5507 | 5516 | "\n", |
5508 | 5517 | "* Around a 2X speed up\n", |
5509 | | - "* About like Cython or CFFI calling mandel 1.5e6 times)\n", |
| 5518 | + "* About like Cython or CFFI calling mandel 1.5e6 times\n", |
5510 | 5519 | "* About like C compiled -O3" |
5511 | 5520 | ] |
5512 | 5521 | }, |
|
0 commit comments