Skip to content

Commit 61362a2

Browse files
author
mattip
committed
extend conclusions
1 parent 09abbd8 commit 61362a2

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

pycon2017_cffi.ipynb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5498,15 +5498,24 @@
54985498
"source": [
54995499
"Things to think about, besides speed:\n",
55005500
"\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",
55045513
"* Which technology is actively maintained (ctypes went into the stdlib to die?)\n",
55055514
"\n",
55065515
"And now the pop-quiz. If we run the pure python version in PyPy what time will we get?:\n",
55075516
"\n",
55085517
"* 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",
55105519
"* About like C compiled -O3"
55115520
]
55125521
},

0 commit comments

Comments
 (0)